Lexicon Schema Definition Language
atproto.com
atproto.com
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.
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
Probably the more likely future is a syntax which compiles to lexicon jsons
https://github.com/cue-lang/cue/issues?q=is%3Aissue%20label%...