Open
Description
Describe the bug
The definition of the schema in schema.json
specifies that some fields may be one of several types.
For instance, the field implies
can either be a string or an array (of strings):
"implies": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/non-empty-non-blank-string"
}
},
{
"$ref": "#/definitions/non-empty-non-blank-string"
}
]
},
This makes it really hard to parse the JSON object in languages like Go where you need to define the types statically:
type Techno struct {
Categories []int `json:"cats"`
Implies []string `json:"implies"` // This may just be a string!
}
Trying to deserialize a JSON object into an instance of this struct will return an error if the JSON input is using a string type instead of an array of strings:
json: cannot unmarshal string into Go struct field Techno.implies of type []string
Expected behavior
Have a single type for each field.