As per OAS, when defining discriminator with explicit mapping, should implicit discriminator value still be accepted? #3918
Unanswered
ondrej-simon
asked this question in
Q&A
Replies: 1 comment 5 replies
-
@ondrej-simon
The last example given in the Discriminator Object section actually illustrates this - "Cat" is handled through an implicit mapping, while "dog" is done with an explicit value in |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have not found any information about this in the documentation (potential hint for extension), so I am asking here.
Let's say I have the following schema which explicitly defines mapping for
Bar
andBaz
objects:I know that when a discriminator is not present, an implicit mapping is to be considered to aid (de)serialization, in this case
type: Bar
would map toBar
, andtype: Baz
would map toBaz
.But when I define explicit mapping, should the implicit value still be allowed, or should the API accept only the manually specified options?
Beta Was this translation helpful? Give feedback.
All reactions