cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlie Read <char...@beebell.com>
Subject Re: jira issue #5401; catching ConstraintViolationException; support for "message" parameter in constraint annotations
Date Tue, 25 Feb 2014 17:51:20 GMT
In browsing issue #5401,

    https://issues.apache.org/jira/browse/CXF-5401

it appears as of Nov, 2014, work was still being done on exceptions
triggered by violations of validation constraints (ie, handling
ConstraintViolationException).

Here are my questions:

* Does the current violation-handler propagate up the "message" encoded in
the
constraint annotation?  IE, does the message reach the consumer of the API?

For example, if I have:

    @Get
    ...
    public Object getSomething()(@QueryParam("color") @NotNull(message =
"color should be specified") String color) {
    ...
    }

will the message "color should be specified" be included in the response
body?

* If there is a constraint violation (Eg, in above example, if
color-parameter is null), where is the
ConstraintViolationException handled? Where can it be intercepted and
custom-processed?

I provisioned a ValidationExceptionMapper (using the CXF 3.0-milestone1
release), but when
I triggered a ConstraintViolationException, the toResponse() method could
not detect it.

* I also noticed in issue #5401 that the logic for returned exceptions is
in flux.

Can someone clarify where the logic stands, and specifically what we should
expect in terms of support for message-propagation back to API consumers
(in the event of ConstraintViolationExceptions)?

Thanks,
Charlie

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message