Hacker News new | past | comments | ask | show | jobs | submit login
Lexicon Schema Definition Language (atproto.com)
2 points by whatever3 3 months ago | hide | past | favorite | 5 comments



I'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


I actually wrote a blogpost explaining that: 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.


Thanks 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


At 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


Another 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%...




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: