Converting JSON schemas to syntax diagrams #201
Replies: 3 comments 5 replies
-
I know @awwright is working on mapping JSON Schema definitions to automata. I would presume that getting a syntax diagram out of an automata would be a much simpler transformation. |
Beta Was this translation helpful? Give feedback.
-
This ought to be fully possible, and I'm building towards doing exactly this. It just requires a bit of work. Unfortunately there's not very much tooling around ABNF; it seems that developers typically re-implement the ABNF by hand. So I'm building that out. However I'm not sure how comprehensible the diagrams would be. Here is the ABNF representing the set of
Most JSON schema keywords can be expressed as grammar like this. It's just a matter of how complicated it is. For the curious: multipleOf is one of these compatible keywords because of two things. First, you can append a In short, I think JSON Schema is the human-friendly format — and ABNF (or regular expression) is the way of describing how a computer would parse a JSON document meeting those specifications. Thanks for the ping @jviotti |
Beta Was this translation helpful? Give feedback.
-
I was also looking for a tool that transforms a given JSON-schema into syntax diagrams. I have since come across some libraries that can transform subsets of JSON-schemas into a constrained form of BNFs (GBNF) [1]. [1]: |
Beta Was this translation helpful? Give feedback.
-
💭 I would like to convert selected JSON schemas to syntax diagrams.
Which tools can help any more with corresponding data visualisations? 🤔
Beta Was this translation helpful? Give feedback.
All reactions