GO-JSONSCHEMA(1)
π 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 IDit 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 ofomitemptytag values. noomitemptyfor you π«--disable-omitzeroβ same energy, but foromitzerotag 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 forgo-jsonschema. the classic. when in doubt, hit it up π--min-sized-intsβ uses sizedintanduintvalues 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 forfoo.jsonif 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 formatURI=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 formatURI=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 formatURI=TYPE. by default, it is derived from the file name. main character naming rights π-t,--struct-name-from-titleβ use the schematitleas the generated struct name. let the schema name itself, slay π--tags stringsβ specify which struct tags to generate. defaults arejson,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 passingURI=FILENAME/URI=PACKAGE/URI=TYPEstyle 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
- ubuntu stonking: go-jsonschema 0.24.1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms