go-jsonschema
go-jsonschema is a Go tool that automatically generates Go structs and unmarshalling code from JSON Schema definitions. It eliminates manual struct definition and includes validation logic based on the schema rules.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | omissis/go-jsonschema |
| Owner | omissis |
| Primary language | Go |
| License | MIT — OSI-approved |
| Stars | 796 |
| Forks | 132 |
| Open issues | 77 |
| Latest release | v0.23.1 (2026-05-09) |
| Last updated | 2026-07-08 |
| Source | https://github.com/omissis/go-jsonschema |
What go-jsonschema is
A code generator written in Go that parses JSON Schema and emits strongly-typed Go data structures with embedded validation during unmarshalling. Supports multiple schemas in a single run, cross-file schema references, and semantic types for dates and times.
Get the go-jsonschema source
Clone the repository and explore it locally.
git clone https://github.com/omissis/go-jsonschema.gitcd go-jsonschema# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires Go 1.25+ per badge. Verify your team's Go version before adoption.
- Generator outputs to stdout by default; integrate into build pipeline with output redirection or flag-based file writing for multiple schemas.
- Generated unmarshalling validates per schema; ensure error handling strategy for validation failures is defined.
- Cross-schema references (external files) and nested $defs support is partial; test complex schema structures before committing.
- Special types (SerializableDate, SerializableTime) add dependencies; review custom type requirements and JSON marshalling behavior.
When to avoid it — and what to weigh
- Incomplete JSON Schema Coverage Needed — Project still lacks support for boolean subschemas (allOf, anyOf, oneOf, not), conditional schemas (if/then/else), and nested location identifiers. Check validation status in README against your schema requirements.
- Highly Dynamic or Weakly-Typed Requirements — If your use case requires json.Number or highly flexible untyped data handling, current implementation does not offer the option for numeric types beyond native Go numbers.
- Custom Semantic Format Support Required — Only dates, times, and basic formats are supported. Email, hostname, IP address, URI, and regex formats are not yet implemented.
- Heavy Customization of Generated Code — Code generation is deterministic and schema-driven; if you need significant post-generation modifications or hand-tuned code, maintenance burden increases.
License & commercial use
MIT License. Permissive OSI-approved license allowing commercial use, modification, and distribution with attribution.
MIT is a permissive license. Commercial use is permitted, provided license and copyright notice are retained in distributed software or documentation. No warranties or indemnification; review with legal if risk profile requires liability coverage.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
As a code generator, security depends on: (1) schema source integrity—malicious schemas could generate unexpected code; validate schema inputs. (2) Generated code validation—unmarshalling includes schema-driven checks, but incomplete validation coverage (missing allOf, anyOf, oneOf) may leave gaps. (3) No identified published vulnerabilities; review recent commits and GitHub security advisories.
Alternatives to consider
quicktype (Go target)
Multi-language code generator with broader schema support and stronger IDE integration. Supports more JSON Schema drafts and output languages (Go, Rust, TypeScript, etc.).
easyjson / manual structs
Manual struct definition with easyjson for fast marshalling. Lower automation but simpler debugging and full control over generated code.
go-swagger (OpenAPI)
Specialized for OpenAPI/Swagger specs with richer API documentation integration. Heavier than go-jsonschema but widely used in enterprise API projects.
Build on go-jsonschema with DEV.co software developers
Evaluate go-jsonschema for your schema-driven code generation needs. Review the validation feature matrix in the README, test against your schemas, and consider incomplete support for advanced schema features before committing.
Talk to DEV.coRelated on DEV.co
Explore the category and the services that help you build with it.
go-jsonschema FAQ
Does go-jsonschema validate JSON at runtime or just generate types?
Can I use go-jsonschema for OpenAPI schemas?
What happens if my JSON Schema uses unsupported features (allOf, anyOf, etc.)?
Is the generated code guaranteed to be production-ready?
Work with a software development agency
Adopting go-jsonschema is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate ai coding agents software in production.
Ready to streamline your Go API validation?
Evaluate go-jsonschema for your schema-driven code generation needs. Review the validation feature matrix in the README, test against your schemas, and consider incomplete support for advanced schema features before committing.