I Built a Free JSON Schema to Go Types Converter (Because schema2go Costs $19)
Last year I was helping a colleague set up a new Go microservice. They needed to generate structs from a JSON Schema they'd inherited from the frontend team. I suggested schema2go — a popular CLI tool that converts JSON Schema to Go types.
They installed it. Ran the command. Got basic structs. But when they tried to use it with their actual schema — which had nested objects, $ref references, and custom formatting — it fell apart. The tags were wrong, the types didn't match, and they spent more time fixing the output than hand-writing the structs would've taken.
I closed the terminal. Opened a text editor. Built something better in an afternoon.
The Problem
Go developers constantly need to convert JSON Schema (or OpenAPI specs) into Go struct definitions. It's a routine task when working with REST APIs, gRPC, or any JSON-based protocol.
The existing tools fall into two categories:
- CLI tools (schema2go, go-jsonschema, etc.) — Require installation, often buggy with complex schemas, and the error messages are opaque.
- IDE plugins (GoLand's built-in code generation) — Expensive ($199/year) and lock you into JetBrains.
Neither approach is great for quick one-off conversions or for developers who don't want to maintain another tool in their PATH.
What I Built
JSON Schema to Go Types Converter — a completely free, browser-based converter that runs entirely client-side.
- No installation. Open the page, paste your schema, get Go code.
- No signup. No account, no email, no "free trial" trap.
- No data collection. Your schema never leaves your browser. Everything runs locally.
- Handles complex schemas. Nested objects, arrays, $ref references, and proper json tags.
- Works offline. Once loaded, you don't need internet.
How It Works
The converter parses your JSON Schema and generates Go struct definitions with:
- Proper PascalCase field names (converted from snake_case or camelCase)
- Correct Go types (string, int, float64, bool, []Type for arrays)
- json tags with omitempty for non-required fields
- Support for nested objects and $ref references
Here's what it produces from a simple schema:
// Generated from JSON Schema
// Source: UserSchema
package main
// User represents a User object
type User struct {
ID int `json:"id"`
Name string `json:"name"`
Email string `json:"email,omitempty"`
Tags []string `json:"tags,omitempty"`
Address Address `json:"address,omitempty"`
}
// Address represents an Address object
type Address struct {
Street string `json:"street"`
City string `json:"city"`
}
Why This Matters
I built this because I was tired of:
- Installing CLI tools just for one-off conversions
- Debugging why schema2go was generating wrong types
- Paying $199/year for GoLand just to generate structs
This tool is my answer to all three problems. It's free, it works in the browser, and it handles the cases that break other tools.
Who Is This For?
- Go developers working with JSON APIs
- Teams migrating from other languages to Go
- Anyone who needs to generate Go structs from OpenAPI specs
- Developers who want a quick, no-hassle conversion tool
Try It Free
No signup. No payment. No watermark. Just paste your JSON Schema and get Go code.
Built by jackgreen.top — Free tools for developers, forever.
Top comments (0)