Forum Discussion
chichepo no worries - I understood the example 😉
With the autogenerated examples I would assume that:
anyOf would generate:
"animals": [
{
"name": "string",
"legs": 0
},
{
"name": "string",
"owner": "string"
}
]and oneOf would generate:
"animals": [
{
"name": "string",
"legs": 0
},
{
"name": "string",
"legs": 0
}
](Here the first item in the oneOf would just be repeated twice...)
Where in the specifications does it specify that the oneOf or anyOf applies to the entire list and not to each item in the list?
My assumption was that below the keyword "items" - the structure for each item in the list is specified. This could be a type:string - in which case all items in the list would have to be of type string. In case it is a oneOf - then each item in the list would be a oneOf... Again - this is just my (maybe wrongly) assumption - it would be great to read an official specification for the use of oneOf and/or anyOf in combination with an array (items field) 🙂