You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mathis-m, is this why its not working in swagger-ui? the id field is marked as readOnly which makes it implicitly non-required on request. this is from the 3.0.3 spec:
If the property is marked as readOnly being true and is in the required list, the required will take effect on the response only.
also the json path correctly fills the the request body textfield from the template with description and without id. so the schema interpretation is correct there.
apart from that, user feedback should happen if the request cannot be sent and why. imho at least
validateParam is used for validation Request Inputs, this creates the need for checking readonly property.
I do not see this implemented till now. OAS:
Relevant only for Schema "properties" definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but SHOULD NOT be sent as part of the request. If the property is marked as readOnly being true and is in the required list, the required will take effect on the response only. A property MUST NOT be marked as both readOnly and writeOnly being true. Default value is false.
Requirements
SHOULD NOT be sent as part of the request (it could be sent in request in given cases) -> do not validate for non existence
This phrase, or the phrase "NOT RECOMMENDED" mean that
there may exist valid reasons in particular circumstances when the
particular behavior is acceptable or even useful, but the full
implications should be understood and the case carefully weighed
before implementing any behavior described with this label.
readOnly being true and is in the required list, the required will take effect on the response only -> required check should be bypassed if property is readOnly: true
required: true: consider bypass for schema itself at
Origin
@mathis-m, is this why its not working in swagger-ui? the
id
field is marked asreadOnly
which makes it implicitly non-required on request. this is from the 3.0.3 spec:also the
json
path correctly fills the the request body textfield from the template withdescription
and withoutid
. so the schema interpretation is correct there.apart from that, user feedback should happen if the request cannot be sent and why. imho at least
Originally posted by @tfranzel in #7242 (comment)
Context
validateParam
is used for validation Request Inputs, this creates the need for checking readonly property.I do not see this implemented till now. OAS:
Requirements
required: true
: consider bypass for schema itself atswagger-ui/src/core/utils.js
Line 432 in 53829f1
required: <List> & properies.readonly
: consider bypass for child property level by adding filter atswagger-ui/src/core/utils.js
Line 494 in 53829f1
The text was updated successfully, but these errors were encountered: