How to use JSON to Go Struct Generator
Infer a Go struct with JSON tags from an object sample. Mixed arrays use interface{}; keys that collide after identifier normalization are rejected.
- Set Text.
- Run the tool, review the result and its stated limitations, then copy or download if needed.
Example & practical use
Infer a Go struct with JSON tags from an object sample. Mixed arrays use interface{}; keys that collide after identifier normalization are rejected. The example below demonstrates Text.
Example input:
{
"text": "{\"name\":\"Ada\",\"age\":37}"
}
Expected result (relevant fields):
"type Root struct {\n Name string `json:\"name\"`\n Age int64 `json:\"age\"`\n}"Features & result limitations
Infer a Go struct with JSON tags from an object sample. Mixed arrays use interface{}; keys that collide after identifier normalization are rejected.
Frequently asked questions
What inputs does JSON to Go Struct Generator accept?
Text
How should I interpret the JSON to Go Struct Generator result?
Infer a Go struct with JSON tags from an object sample. Mixed arrays use interface{}; keys that collide after identifier normalization are rejected.
Where does JSON to Go Struct Generator process my data?
Inputs are processed locally in your browser. Submitted text is not sent to external services. A successful-run event increments an aggregate tool counter without your input.