~emersion/go-jsonschema

A JSON schema code generator for Go
Handle arrays in schema type
readme: specify supported version of the JSON schema spec
readme: add link to JSON schema website

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~emersion/go-jsonschema
read/write
git@git.sr.ht:~emersion/go-jsonschema

You can also use your local clone with git send-email.

#go-jsonschema

A JSON schema code generator for Go.

JSON schema draft 2020-12 is supported.

#Usage

jsonschemagen -s <schema> -o <output>

One Go type per definition will be generated.

  • int64 is used for "type": "integer".
  • json.Number is used for "type": "number".
  • Go structs are generated for objects with "additionalProperties": false.
  • json.RawMessage is used when a value can have multiple types. Helpers are generated for allOf, anyOf, oneOf, then, else and dependantSchemas which are references.

#License

MIT