atproto utils for zig zat.dev
atproto sdk zig

update readme with comptime extraction example

Changed files
+11 -2
+11 -2
README.md
··· 79 navigate nested json without verbose if-chains: 80 81 ```zig 82 - // instead of 6 nested if-checks: 83 const uri = zat.json.getString(value, "embed.external.uri"); 84 - const items = zat.json.getArray(value, "posts"); 85 const count = zat.json.getInt(value, "meta.count"); 86 ``` 87 88 ## specs
··· 79 navigate nested json without verbose if-chains: 80 81 ```zig 82 + // runtime paths for one-offs: 83 const uri = zat.json.getString(value, "embed.external.uri"); 84 const count = zat.json.getInt(value, "meta.count"); 85 + 86 + // comptime extraction for complex structures: 87 + const FeedPost = struct { 88 + uri: []const u8, 89 + cid: []const u8, 90 + record: struct { 91 + text: []const u8 = "", 92 + }, 93 + }; 94 + const post = try zat.json.extractAt(FeedPost, allocator, value, .{"post"}); 95 ``` 96 97 ## specs