Is it possible to change the result of @NotNull from "text/plain" to "application/json" in JAX-RS?

Let's have a REST service in JAX-RS with the following method:
The parameter member is null validation using annotations NotNull. If you make a POST request with an empty body, the server will return a 400 response, which is logical, but in the body he writes is automatically generated additional error information in text/plain format.
Actually the question, is it possible to change the format of the generated information on JSON and how to do it? Why he basically defaults to text/plain and not what is specified in the parameters Produces annotation to a method?
July 9th 19 at 10:42
1 answer
July 9th 19 at 10:44

Find more questions by tags JavaJava EE