We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
BeanValidation's @NotNull annotation integrates seamlessly into openapi schema generation - I much appreciated feature.
Unfortunately, there is an inconsistency regarding @NotNull and method parameters.
The following endpoint doesn't mark the input parameter Payload as required:
Payload
@POST public Response create(@Nonnull @NotNull @Valid Payload payload) { return Response.ok().build(); }
generated schema:
post: requestBody: content: application/json: schema: $ref: "#/components/schemas/Payload"
Manually adding @RequestBody(required = true) the the create method yields in the desired output:
@RequestBody(required = true)
post: requestBody: content: application/json: schema: $ref: "#/components/schemas/Payload" required: true
It would be really nice, if a @NotNull annotation on a body parameter automatically added the required: true flag.
@NotNull
required: true
The text was updated successfully, but these errors were encountered:
The following worked for me:
@POST public Response create(@Nonnull @NotNull @Valid @RequestBody Payload payload) { return Response.ok().build(); }
Sorry, something went wrong.
I'm sorry, I was wrong (probably issues with dependencies). It doesn't work the way I wrote, the request body is not generated as required.
No branches or pull requests
BeanValidation's @NotNull annotation integrates seamlessly into openapi schema generation - I much appreciated feature.
Unfortunately, there is an inconsistency regarding @NotNull and method parameters.
The following endpoint doesn't mark the input parameter
Payload
as required:generated schema:
Manually adding
@RequestBody(required = true)
the the create method yields in the desired output:It would be really nice, if a
@NotNull
annotation on a body parameter automatically added therequired: true
flag.The text was updated successfully, but these errors were encountered: