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?