-
Notifications
You must be signed in to change notification settings - Fork 90
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
Require requestBody by default #1858
Require requestBody by default #1858
Conversation
This was a bit tricky to implement. There are two code paths where we read create a request body during code scanning:
The first case is a simple read of the annotation with no other changes made. The second case reads the annotation if it's present and then combines it with more information that can be discovered from the method. This scanning code assumes that if a property of If we set If we try to set That's why I ended up extending I'm still not super happy about this approach, it wouldn't scale very well if there were lots of properties with a default value and it means |
I'm a bit surprised that the 4.0 TCK is passing without eclipse/microprofile-open-api#627 having been merged. I guess that just shows that there was a gap in the TCK coverage. |
Now that requestBody is required by default, update all the tests to expect that.
When generating a requestBody for a resource method or from an annotation, it should be required by default, unless something explicitly indicates that it's not required.
9f64f10
to
a5376ab
Compare
Rebased on |
When generating a requestBody for a resource method or from an annotation, it should be required by default, unless something explicitly indicates that it's not required.
The change affects generation of
requestBody
only when scanning code. If there's an operation which is annotated@Consumes
, the generatedrequestBody
will haverequired = true
, unless the user annotates the method with@RequestBody(required = false)
.However, if the user calls
OASFactory.createRequestBody
in a filter or reader and doesn't callsetRequired
, then the output will not includerequired = true
.Implements eclipse/microprofile-open-api#627
Also delete a bunch of test json files which weren't being used.