Given a [request body(https://spec.openapis.org/oas/v3.0.3#request-body-object) with "required": false:
"paths": {
"/request-body/optional": {
"post": {
"requestBody": {
...
"required": false
},
...
}
}
when generating JAX-RS code with OpenApi2JaxRs, method parameters representing the request body have the @NotNull annotation, as if they were required:
@Path("/optional")
@POST
@Consumes("application/json")
void optionalRequestBody(@NotNull Content data);
I believe the @NotNull annotation should only be present when the request body has the "required": true property.