zio-json
zio-json copied to clipboard
Feat-string-like-field-decoder
This PR should provide support for string-like types (T <: String
) to be used as keys in json objects.
The implementation reuses any applicable existing JsonDecoder, e.g. a decoder for a string-based const union.
Foo(aOrB: Map["A" | "B", Int]) derives JsonDecoder
value encoded/decoded
Foo(Map("A" -> 1, "B" -> 2))
json
{"aOrB":{"A":1,"B":2}}