Schema properties declared with oneOf
ignore the readonly
flag on request samples
#2574
Labels
oneOf
ignore the readonly
flag on request samples
#2574
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: