cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <>
Subject [jira] [Commented] (CXF-5309) Support Bean Validation API for JAX-RS
Date Fri, 15 Nov 2013 16:51:24 GMT


Sergey Beryozkin commented on CXF-5309:

Hi Andriy, many thanks, I've applied your patch with few minor updates (example, JAXRSInvoker
would always return MessageContentsList, plus few other minor updates).

What I've realized, though I guess we did touch on it earlier, is that if we have JAX-RS Response
wrapping an entity then the only thing we can do at the moment is to validate a non-null entity
itself, assuming it has the embedded constraints, but we always miss on method-level annotations
such as @NotNull.

When we have a null Response entity we can check if method annotations have @NotNull and if
yes then return a custom NotNulConstraintViolation. Thus we can cover the NotNull validation
at least. But I wonder if we can do better than that ? Have a look please at ValidatorProvider#validateResponse(Method
m, Object returnV), can we iterate over all the method annotations, check for the ones with
Constraints, if yes, then invoke the attached ConstraintValidator. Can that work at all ?
It is not a critical issue, if it is not possible to do then I can add a NotNull check only
and then resolve this issue

Thanks, Sergey  

> Support Bean Validation API for JAX-RS
> --------------------------------------
>                 Key: CXF-5309
>                 URL:
>             Project: CXF
>          Issue Type: Sub-task
>          Components: JAX-RS, JAX-WS Runtime
>            Reporter: Sergey Beryozkin
>         Attachments: patch-jaxrsvalidationinvoker-tests.txt, patch-validation-exception-mapper.txt,
patch-validation-paramnameprovider.txt, patch-validation-poc.txt, patch-validation-spring-tests.txt,

This message was sent by Atlassian JIRA

View raw message