-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Description
I have the following case:
My Api call returns a Variant that contains a bool as discriminator. The two values are either an error object or an array of a value.
Example: (no valid code)
success: boolean
value:
oneOf:
{errorCode: number, message: string}
arrayOf {description: string, data: {...} ...}
Descriminator:
discriminator:
propertyName: success
mapping:
false: '#/components/shema/Error'
true: ?????
The problem is that in the discriminator mapping only the schema of the items contained in the array can be referenced because no seperate schema is made for arrays.
For the autogeneration, however, which pays attention to the discriminator, it is now necessary to recognise both fields separately or, from my point of view, responses and discriminator then contradict each other
Did i miss something and there is already a solution for that?
Metadata
Metadata
Assignees
Labels
No labels