Find a file
2022-10-10 13:16:08 +02:00
cmd/jsonschemagen Generate helpers for then, else and dependantSchemas 2022-10-07 12:10:12 +02:00
go.mod Initial commit 2022-10-06 09:26:45 +02:00
go.sum Initial commit 2022-10-06 09:26:45 +02:00
LICENSE Initial commit 2022-10-06 09:26:45 +02:00
README.md readme: specify supported version of the JSON schema spec 2022-10-10 13:16:08 +02:00
schema.go Reset schema when unmarshalling "true" 2022-10-07 12:02:35 +02:00

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