4 ms·
Lexicon Schema Definition Language
- verdverm 2y agoI'm curious why they didn't use JSONSchema or OpenAPI to define lexicon schemas, and instead created another schema system for defining what a valid record looks like
- pfraze 2y agoI actually wrote a blogpost explaining that: https://www.pfrazee.com/blog/why-not-rdf https://www.pfrazee.com/blog/why-not-rdf The TLDR is that we started with JSONSchema and then evolved it. OpenAPI didn't quite fit our needs either. Lexicon doesn't just describe APIs; it also describes records stored in user's data repositories.
- verdverm 2y agoThanks for chiming in Paul Have you looked at CUE? I saw you mentioned the idea of closedness at the end of the ATProto doc. It certainly seems like there is influence, but great minds also think alike! There are some interesting use cases around detecting backward (in)compatibility. Might not make sense to define them in CUE, but maybe have CUE around to enhance the DX. Happy to toss around ideas off of HN if it interests you. I'm sure the CUE team would join the conversation too. We were talking just last week about CUE schemas for the ATProto lexicon and some hard parts around cyclic references
- pfraze 2y agoAt a glance it looks pretty interesting. I'd have to do a much deeper eval to say if CUE could function as a Lexicon replacement. Probably the more likely future is a syntax which compiles to lexicon jsons
- verdverm 2y agoAnother angle might be for a future lexicon schema syntax to be encode/decode friendly with CUE, which aims to have two-way interoperability with a number of schema systems (type systems too). https://github.com/cue-lang/cue/issues?q=is%3Aissue%20label%3Aencoding%20 https://github.com/cue-lang/cue/issues?q=is%3Aissue%20label%...
- deleted 2y ago[deleted]