Commit b57a356bb6

OfekShochat <50481015+OfekShochat@users.noreply.github.com>
2022-04-19 07:15:30
std.json add stringify struct with string as array
1 parent 6245349
Changed files (1)
lib
lib/std/json.zig
@@ -3268,6 +3268,11 @@ test "stringify struct" {
     }{ .foo = 42 }, StringifyOptions{});
 }
 
+test "stringify struct with string as array" {
+    try teststringify("{\"foo\":\"bar\"}", .{ .foo = "bar" }, StringifyOptions{});
+    try teststringify("{\"foo\":[98,97,114]}", .{ .foo = "bar" }, StringifyOptions{ .string = .Array });
+}
+
 test "stringify struct with indentation" {
     try teststringify(
         \\{