-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Are you using jest or chai?
Jest
Are you using OpenAPI 2, 3.0.X, or 3.1.0?
OpenAPI 3.0.3
Describe the bug clearly
When I use oneOf for items in an array with more than 2 distinct references, it fails randomly and can't discriminate which is the matched entity type (even with discriminator property).
Steps to reproduce the bug:
- Create an open api spec with
oneOfwith more than 2 - for example
List:
type: array
items:
oneOf:
- $ref: '#/components/schemas/Account'
- $ref: '#/components/schemas/Item'
- $ref: '#/components/schemas/Payment'
- From an endpoint, return this array with a mix of these 3 entities, eg
[
{ type: 'Account' },
{ type: 'Item' },
{ type: 'Payment' }
]
(my actual entities are more complex than this, but for the sake of a simple bug description, this will suffice)
- It fails on 1 of the 3 entity types, if I remove one and only do 2 entity types then it is fine.
What did you expect to happen instead?
It validates the array correctly
Are you going to resolve the issue?
If I'm pointed in the right direction I may be able to!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working