Superfluous anyOf wrappers for array items.
jdesrosiers opened this issue · 2 comments
jdesrosiers commented
When using the default setting for "Array Validation", "AnyOf (single schema)" , schemas for arrays with only one type are generated with a superfluous singleton anyOf
wrapper. This leads to confusion. It would be nice if the anyOf
wrapper was only generated if there is more than one type.
jackwootton commented
I agree. Thank you for pointing this out. The backend is currently being rewritten and I will factor this into this requirements. Just to be sure, that instead of this
{
"$schema": "http://json-schema.org/draft-07/schema",
"items": {
"anyOf": [
{
"type": "string",
"default": "",
"examples": [
"home",
"green"
]
}
]
}
}
It's preferable to have
{
"$schema": "http://json-schema.org/draft-07/schema",
"items": {
"type": "string",
"default": "",
"examples": [
"home",
"green"
]
}
}
jackwootton commented
This has been fixed in the new version available at www.jsonschema.net