2 ms·
Naming fields is a small pain, the PITA is that JSON does not have native encoding for enum/variant/sum types. So now there are multiple ways to encode them: in
by karavelov 6y ago
Naming fields is a small pain, the PITA is that JSON does not have native encoding for enum/variant/sum types. So now there are multiple ways to encode them: internally tagged, externally tagged, adjacently tagged, implicit/untagged. And JSON schema does not solve that at all: you can write schemas for all of them, but they do not convey the same information in the end languages even if they have all the type capabilities.
- nly 6y agoEnum and variant/sum types are supported by a lot of serialization frameworks that have JSON serializations though. Thrift, Avro, Protocol Buffers, Flatbuffers etc. JSON is not a framework for serialization anymore than XML is.