{"id":19462472,"url":"https://github.com/ryojerryyu/go-jsonschema","last_synced_at":"2026-04-17T09:31:06.613Z","repository":{"id":204349455,"uuid":"711628812","full_name":"RyoJerryYu/go-jsonschema","owner":"RyoJerryYu","description":"A JSON schema code generator for Go, supporting draft 2020-12, supporting reference resolving betewen multiple schema files.","archived":false,"fork":false,"pushed_at":"2023-11-02T19:34:26.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T12:48:49.846Z","etag":null,"topics":["json-schema"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RyoJerryYu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-29T20:46:46.000Z","updated_at":"2023-11-01T19:52:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7055413-c8ee-43a3-93a4-9806bc8cf238","html_url":"https://github.com/RyoJerryYu/go-jsonschema","commit_stats":null,"previous_names":["ryojerryyu/go-jsonschema"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/RyoJerryYu/go-jsonschema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyoJerryYu%2Fgo-jsonschema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyoJerryYu%2Fgo-jsonschema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyoJerryYu%2Fgo-jsonschema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyoJerryYu%2Fgo-jsonschema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RyoJerryYu","download_url":"https://codeload.github.com/RyoJerryYu/go-jsonschema/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyoJerryYu%2Fgo-jsonschema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31923066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T09:10:15.403Z","status":"ssl_error","status_checked_at":"2026-04-17T09:10:14.455Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-schema"],"created_at":"2024-11-10T18:01:29.025Z","updated_at":"2026-04-17T09:31:06.597Z","avatar_url":"https://github.com/RyoJerryYu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-jsonschema\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/RyoJerryYu/go-jsonschema)](https://goreportcard.com/report/github.com/RyoJerryYu/go-jsonschema) [![Go Reference](https://pkg.go.dev/badge/github.com/RyoJerryYu/go-jsonschema.svg)](https://pkg.go.dev/github.com/RyoJerryYu/go-jsonschema) ![Go version](https://img.shields.io/github/go-mod/go-version/RyoJerryYu/go-jsonschema/master) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/RyoJerryYu/go-jsonschema?sort=semver)\n\nA [JSON schema] code generator for Go, supporting draft 2020-12, \nsupporting reference resolving between multiple schema files.\n\nThis module is a fork of [git.sr.ht/~emersion/go-jsonschema], with the following improvement:\n\n- Support stdin and stdout for input and output.\n- Support multiple schema files. Will resolve references between files correctly.\n- Support base local directory for resolving relative references, and base URI for resolving downloaded references.\n- Support special uppercase field names, such as `ID` and `URL`.\n- Support additional properties and pattern properties.\n\nFor the above features, we introduce some breaking changes,\nso I publish this module instead of raising a PR.\n\n## Installation\n\n```sh\ngo install github.com/RyoJerryYu/go-jsonschema/cmd/jsonschemagen\n```\n\n## Usage\n\n```sh\njsonschemagen -s \u003cschema\u003e -o \u003coutput\u003e\n```\n\nOr, with the support of stdin/stdout and multiple schema files:\n\n```sh\nfind schema -name '*.json' | xargs jsonschemagen --rootdir=$PWD -n structs -u id -u url \u003e out/generated.go\n```\n\nFull usage:\n\n```\nGenerate Go types and helpers for the specified JSON schema.\nIf no schema file is specified or specified to \"-\", read from stdin.\n\nUsage:\n  jsonschemagen [flags] [schema file]...\n\nExamples:\n$ find schema -name '*.json' | xargs jsonschemagen --rootdir=$PWD -n out \u003e out/generated.go\n\nFlags:\n      --baseuri string                 base URI\n  -h, --help                           help for jsonschemagen\n  -o, --output string                  The output filename.\n                                       If not provided or specified to \"-\", output to stdout.\n  -n, --packagename string             package name\n      --rootdir string                 root directory\n  -s, --schema string                  The schema filename, deprecated.\n                                       recommended to use positional argument.\n                                       \"-\" for stdin.\n  -u, --upper-property-names strings   Apply full upper case to the property names.\n                                       e.g. given \"id\", \"Id\" or \"ID\" as flags, when a type or field name \n                                       parsed as \"Id\", would be converted as \"ID\"\n      --with-additional-properties     Generate additional properties and pattern properties\n```\n\nOne Go type per definition will be generated.\n\n- `int64` is used for `\"type\": \"integer\"`.\n- `json.Number` is used for `\"type\": \"number\"`.\n- schemas with `\"type\": [\"null\", \u003cother\u003e]` and `{\"oneOf\": [{\"type\": \"null\"}, \u003cother\u003e]}` are considered as optional, will be generated as `*\u003cother\u003e`.\n- Resolvable references are generated as the corresponding Go type. Non-resolvable references are generated as `json.RawMessage`.\n- Additional properties and pattern properties are not generated by default. Use `--with-additional-properties` to generate them as `map[string]json.RawMessage` .\n\n## License\n\n[MIT](./LICENSE)\n\n[git.sr.ht/~emersion/go-jsonschema]: https://git.sr.ht/~emersion/go-jsonschema\n[JSON schema]: https://json-schema.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryojerryyu%2Fgo-jsonschema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryojerryyu%2Fgo-jsonschema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryojerryyu%2Fgo-jsonschema/lists"}