| ... | ... | @@ -181,6 +181,7 @@ pub fn writeStreamArbitraryDepth( |
| 181 | 181 | /// * If the union declares a method `pub fn jsonStringify(self: *@This(), jw: anytype) !void`, it is called to do the serialization instead of the default behavior. The given `jw` is a pointer to this `WriteStream`. |
| 182 | 182 | /// * Zig `enum` -> JSON string naming the active tag. |
| 183 | 183 | /// * If the enum declares a method `pub fn jsonStringify(self: *@This(), jw: anytype) !void`, it is called to do the serialization instead of the default behavior. The given `jw` is a pointer to this `WriteStream`. |
| 184 | /// * Zig untyped enum literal -> JSON string naming the active tag. |
| 184 | 185 | /// * Zig error -> JSON string naming the error. |
| 185 | 186 | /// * Zig `*T` -> the rendering of `T`. Note there is no guard against circular-reference infinite recursion. |
| 186 | 187 | /// |
| ... | ... | @@ -449,7 +450,7 @@ pub fn WriteStream( |
| 449 | 450 | return try self.write(null); |
| 450 | 451 | } |
| 451 | 452 | }, |
| 452 | | .Enum => { |
| 453 | .Enum, .EnumLiteral => { |
| 453 | 454 | if (comptime std.meta.trait.hasFn("jsonStringify")(T)) { |
| 454 | 455 | return value.jsonStringify(self); |
| 455 | 456 | } |