GO-JSONSCHEMA(1)

πŸ“¦ version 0.24.1, in ubuntu stonking

πŸ’– NAME πŸ’–

go-jsonschema β€” the lil bestie that generates Go code from JSON Schema files ✨ (yes, really, it just does that, and it does it so well)


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you have JSON Schema files, right? and you need Go code. that's it. that's the whole vibe. go-jsonschema generates Go code from JSON Schema files, no cap, no drama, no manual struct-writing at 3am πŸ’…

πŸš€ Usage:

go-jsonschema FILE ... [flags]

feed it one or more FILEs and it does its thing. iconic behaviour honestly 🫢

πŸŽ€ Flags:

okay bestie, here's the whole menu, every single one, don't skip any πŸ”₯

  • --capitalization strings β€” tell it how you want your Go capitalization to go for a given string. like, by default a field named 'id' becomes 'Id' (πŸ™ˆ lowkey cursed), but with --capitalization ID it gets generated as 'ID'. glow-up achieved πŸ’…
  • --disable-custom-types-for-maps β€” do not generate custom types when generating maps. simple as that.
  • --disable-omitempty β€” kills the addition of omitempty tag values. no omitempty for you 🚫
  • --disable-omitzero β€” same energy, but for omitzero tag values. bye bestie πŸ‘‹
  • --disable-readonly-validation β€” do not include validation of readonly fields. hands off the readonly ones fr.
  • -e, --extra-imports β€” allows extra imports (aka the non-standard-library ones) 🧚
  • -h, --help β€” help for go-jsonschema. the classic. when in doubt, hit it up πŸ’–
  • --min-sized-ints β€” uses sized int and uint values based on the min and max values for the field. precision queen behavior πŸ‘‘
  • --minimal-names β€” uses the shortest possible names. no yapping, just names βœ‚οΈ
  • --only-models β€” generate only models β€” no unmarshal methods, no validation. just the models, nothing else, periodt.
  • -o, --output string β€” the file to write to (- for standard output) (default "-"). so by default it's yapping straight at your stdout 🌸
  • -p, --package string β€” the default name of the package to declare your Go files under, unless it gets overridden with --schema-package. the humble default πŸ’œ
  • --resolve-extension strings β€” add a file extension that's used to resolve schema names. like, {"$ref": "./foo"} will also look for foo.json if you provide --resolve-extension json. it's giving detective energy πŸ”
  • --schema-output strings β€” the file to write (- for standard output) a specific schema ID to. must be in the format URI=FILENAME. respect the format bestie, it's not optional ✨
  • --schema-package strings β€” the name of the package to declare Go files for a specific schema ID under. must be in the format URI=PACKAGE. again, format is the moment πŸŽ€
  • --schema-root-type strings β€” override the name used for the root type of a specific schema ID. must be in the format URI=TYPE. by default, it is derived from the file name. main character naming rights πŸ‘‘
  • -t, --struct-name-from-title β€” use the schema title as the generated struct name. let the schema name itself, slay πŸ’…
  • --tags strings β€” specify which struct tags to generate. defaults are json, yaml, mapstructure (default [json,yaml,mapstructure]) β€” the holy trinity fr fr 🫢
  • -v, --verbose β€” verbose output. it will simply tell you everything πŸ—£οΈ
  • --yaml-extension strings β€” add a file extension that should be recognized as YAML. default is .yml, .yaml. (default [.yml,.yaml]) πŸ“
ngl bestie, nothing in here is secretly dangerous, but if you're passing URI=FILENAME / URI=PACKAGE / URI=TYPE style values, the equal sign is load-bearing β€” get it wrong and it won't do the thing. iykyk πŸ’€

and that's the whole page, no notes πŸ’– this was go-jsonschema version 0.24.1-1, dropped August 2026 β€” go forth and generate, you absolute icon, mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from