Instead of embedding types within types (the “address” type within the “person” type in your final example, for instance) can you reference types from elsewhere? I don’t know JSONSchema to know if it can do it either, I’m just wondering if I want to reuse the “address” type within a “business” type, am I going to have to declare it all over again or can I reuse a single declaration of an “address” type?
yo ryan,
yes you can. read the “Extending and Referencing” section of http://json-schema.org/, lifting that bit up into orderly would perhaps be v0.
lloyd
Reminds me of thrift / protobuf a bit. probably an (extended) syntax based on thrift / protobuf will be sufficient. Imho this would be a nice thing to have, as we could take the schemas as a foundation for interfaces+data-type-definitions and vice-versa
Hmm… Looks strangely similar to a type definition in a programming language!
BTW, I like the support for nested types. Many times when prototyping a system I don’t need to reuse the type definitions, so being forced to name things feels pointless.
I like this a lot.
Is there a way to specify object keys that are not constants (e.g., a set of employees keyed by employeeID), or do I have to turn it into an array with the emplID in each object?
Hi Bill,
You would have to change your representation. JSONSchema doesn’t can’t express constraints like this - ranges or patterns of acceptable keys.
lloyd