Forum Discussion
Hi chichepo
Thanks for your comments. Yes I am using 3.0.x
Can you please explain a little more what you mean by:
In conclusion, the difference in the way both items are validated.
I can see the example code generated by Swagger for both lists are the same? If the difference is in the validation - which of the two lists is correct? The one using oneOf or the one using anyOf?
Regarding your example above I assume you meant type: array and not type:string for "Animals" 😉
When I read the documentation for oneOf vs anyOf (you made a screenshot above) - then it makes me think that for arrays:
When anyOf is used in an array - then each item in the array can be:
- a Dog followed by a Cat
- a Cat followed by a Dob
- just a Dog
- just a Cat
When oneOf is used in an array - then each item in the list can be exactly a Dog or a Cat.
In my opinion oneOf is the correct use for the above example-lists...?
Related Content
- 3 years ago
- 3 years ago
- 3 years ago
- 3 years ago
- 6 years ago
Recent Discussions
- 10 days ago
- 2 months ago