jupyter-book / myst-spec

MyST is designed to create publication-quality, computational documents written entirely in Markdown.
https://mystmd.org/spec
MIT License
14 stars 6 forks source link

Auto-generate ts types from json schema #8

Closed fwkoch closed 2 years ago

fwkoch commented 2 years ago

This mostly uses json-schema-to-typescript to generate typescript types. It requires a few changes to the json schema files - particularly nesting all properties under allOf key, so:

...
  "properties": {...},
  "allOf": [
    { "$ref": ...}
  ]
...

becomes:

...
  "allOf": [
    { "properties": {...} },
    { "$ref": ...}
  ]
...

Functionally, this does not change the json schema at all, but the autogeneration works better!