4 ms·
I wish json docs had a schema you exchange for your objects, and evaluate compliance against the schema. XSDs one of the only redeeming qualities of XML.
by exabrial 2y ago
I wish json docs had a schema you exchange for your objects, and evaluate compliance against the schema.
XSDs one of the only redeeming qualities of XML.
- ivell 2y agoYou can use JSONSchema, https://json-schema.org/ https://json-schema.org/
- halfcat 2y agoDoes JSON Schema help here? https://json-schema.org/ https://json-schema.org/
- dekhn 2y agoI've worked with json schema and have mixed opinions- it was extremely cumbersome to do some things that should be simple, and very simple to do things that should be extremely cumbersome. I agree that XSD was one of the only redeeming qualities of XML- the schema schema itself was fairly well thought-through. Personally I prefer the IDL-style languages- that would include CORBA (just the schema and encoding), protobufs, and the ur-IDL that Sun RPC was based on, XDR. Protobufs have gone through some weird evolution, though- IIRC proto3 went tyhrough a full 180 on required/optional fields.