Lexicon vs JSON Schema #2102
-
If I remember right, Lexicon started out very close to JSON Schema, maybe even close enough that they were compatible? But it's since diverged more, to handle eg refs, records, tokens, etc. What's your take on where they are right now? Does current Lexicon feel like modified JSON Schema? Or more like its own thing, with only passing similarities? For someone implementing Lexicon schema validation in a language with mature JSON Schema libraries, would your gut instinct be to customize them to support Lexicon? Or implement Lexicon from scratch, and only maybe borrow bits of the libs where they're useful? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
One of the more awkward parts of using JSON schema (well over a year ago) in atproto was that it was difficult to express open unions of objects and strings. Being able to express this is pretty common/important to us, since we want folks to be able to spec apps that can maintain forward- and backward-compatibility as much as possible, in such a low-coordination environment. Being able to additionally discriminate those open unions in an explicit, namespaced way goes a step further in the same direction. In a way we're sleeping on the value of these areas of lexicon while things are limited to schemas for a single app. |
Beta Was this translation helpful? Give feedback.
One of the more awkward parts of using JSON schema (well over a year ago) in atproto was that it was difficult to express open unions of objects and strings. Being able to express this is pretty common/important to us, since we want folks to be able to spec apps that can maintain forward- and backward-compatibility as much as possible, in such a low-coordination environment. Being able to additionally discriminate those open unions in an explicit, namespaced way goes a step further in the same direction. In a way we're sleeping on the value of these areas of lexicon while things are limited to schemas for a single app.