Open LondonAppDev opened 3 years ago
this is most likely related to #6250
the bug also appears for the most recent version 3.48.0
hitting execute simply won't work unless application/json
is selected. both alternatives simply result in a dead button and no fired request.
This happens because your id
property is explicitly required by the schema.
@tim-lai what is the excpected behaviour here? From validation perspective this is fine. A required property is not provided.
Question: should readonly disable the required check?
@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
@tfranzel Thanks the research on the spec. Going to look into this and provide a fix the next days.
Q&A (please complete the following information)
Content & configuration
Steps to re-produce:
POST /sample/
endpointmultipart/form-data
description
You should see that nothing happens.
Example Swagger/OpenAPI definition:
If you remove the
readOnly: true
line from theid
field on theSample
schema, the problem goes away.Describe the bug you're encountering
The execute button is non-responsive when trying to make a POST request to an API with a schema that contains a read only field.
Additional context or thoughts
I suspect that the validation done when hitting Execute is including the
id
read only field in the backround?