Closed valeriaA closed 2 years ago
items
? {"items": [{...}]}
applies the {...}
schema only to the first element of the array. {"items": {...}}
applies the {...}
schema to all elements of the array.items
, that shouldn't make the one element required. Only "minItems": 1
should do that, so that's probably a bug in the implementation (which we can't help you with)@handrews
I can't find the repository you mentioned (implementation repository) can you give me the link please?
Thank you!
@valeriaA we'll need to know what implementation you're using. Please have a look at https://json-schema.org/implementations.html. This lists all of the implementations we know about and contains links to them.
Also, I see that you've asked the question on StackOverflow. Please allow time for the community to answer there before reposting your question elsewhere.
I configured the json schema and it looked like this:
Note that the "resources" array is not required, it is not mandatory.
However... when I run my test and it returns an empty array in "resources":
I get the following message:
"#/data/resourceGroups/0/resources: failed schema #/properties/data/properties/resourceGroups/items/0/properties/resources: 1 item required; only 0 were supplied."
I don't understand how 1 item is required if the array is not required.
and still have( "uniqueItems": true )
which in theory would accept a [] in the return, according to the Json schema documentation.
I've tried passing minItems=0 and many other things and nothing has worked.