Skip to content

Generate typescript interfaces and deserializer from a JSON schema

License

Notifications You must be signed in to change notification settings

ncpenke/json-schema-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-schema-typescript

Generate typescript interfaces and deserializer logic from a JSON schema

Features

  • Generate named interfaces and enums for to the root of the schema ane each definition in the top-level "$defs" property
  • Generate inline interfaces and enums for each property that doesn't have an explicit definition in "$defs"
  • Handle references to external schemas by importing using the relative path
  • JSON deserializer that uses autogenerated type information.

Assumptions:

  • All definitions are in the top-level "$defs" property
  • External schema references use relative paths
  • The name of the schema file is used as the root type name of the schema

Note:

  • Features in JSON schema which result in ambiguous during deserialization are not supported.

Implementation Notes

  • The JSON schema is first converted to an intermediate representation that drives the generator the generate the top-level types and also the type information used by the JSON deserializer.

About

Generate typescript interfaces and deserializer from a JSON schema

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published