Nice to see that I'm not the only one who wants to generate code from JSON.
However, plain JSON/YAML is the only notation that can be used as a source for code generation.
I'd like to propose OpenAPI V3 generation, assume you have the following JSON file:
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"fields": {
"type": "string"
}
}
}
}
}
this JSON file may end up in a go struct like:
type Error struct {
Message string `json:"message"`
Fields string `json:"fields"`
}
type SomeStruct struct {
Error Error `json:"error"`
}
thoughts?
Nice to see that I'm not the only one who wants to generate code from JSON.
However, plain JSON/YAML is the only notation that can be used as a source for code generation.
I'd like to propose OpenAPI V3 generation, assume you have the following JSON file:
{ "type": "object", "properties": { "error": { "type": "object", "properties": { "message": { "type": "string" }, "fields": { "type": "string" } } } } }this JSON file may end up in a go struct like:
thoughts?