-
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
Schema properties declared with oneOf
ignore the readonly
flag on request samples
#2574
Comments
hi @renke0, thank you for the issue. |
Hi @AlexVarchuk. You are correct, and the spec has a Edit: I updated the issue description to use |
@renke0 Hi- I'm dropping in from the OpenAPI project and do not speak on behalf of Redocly :-) In 3.1, |
Describe the bug
I have a component schema (
Body
) with a property (prop2
) that should bereadonly
and its value can be either anumber
or anenum
key. I declared it withoneOf
to accomplish the desired result, and the property is correctly hidden when I check the Request Body Schema in the preview doc. Unfortunately, the same is not true for the generated sample request in the sidebar.To Reproduce
Steps to reproduce the behavior:
Given this
redocly.yaml
fileNone
And this OpenAPI file(s)
redocly ...
The generated request sample payload contains the field that should be
readonly
Expected behavior
The
prop2
field should be omitted, in the same fashion it is in the Request Body Schema definition.Logs
-
OpenAPI description
-
Redocly Version(s)
1.19.0
Node.js
Version(s)v20.13.1
Additional context
-
The text was updated successfully, but these errors were encountered: