Allows the embedding of already-encoded JSON strings into objects in order to avoid double encoded values.
const an_encoded_json_value = "{\"over\": 9000}";
const str = try std.json.stringifyAlloc(allocator, .{
.name = "goku",
.power = zul.jsonString(an_encoded_json_value),
}, .{});
zul.JsonString
wraps a []const u8
and implements jsonStringify
to write the value as-is. This prevents double-encoding of already-encoded values.
Use the zul.jsonString(str)
helper to create a JsonString
.