-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discriminators do not obey writeOnly
#882
Comments
Seems like property used as discriminator cannot have modifiers such as As specifications says:
Your response object contains discriminator definition, but you're trying to hide discriminator field ( |
Thanks for the explanation. What's interesting is that none of the validators/linters seem to complain about this, but that's a completely separate issue. Sorry for the noise. |
Awesome, no worries. Thanks, @neluzhin! 🙏 |
I wanted to use a discriminator as part of a POST call, but not include the discriminator property as part of the response. I added
writeOnly
to everywhere it was legal to do so, but the property still shows up. This is also true for the properties on the discriminated object which are also marked readonly.In the below screenshot,
optionsType
is awriteOnly
property.Here's a reduced test case:
EDIT: Forgot to mention I'm using the official CDN hosted version of v2.0.0-rc.4
The text was updated successfully, but these errors were encountered: