[ 
https://issues.apache.org/jira/browse/CXF-5401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13827666#comment-13827666
 ] 

Sergey Beryozkin commented on CXF-5401:
---------------------------------------

Hi Andriy, thanks for the patch, I applied it. 
I kept the earlier introduced single-argument validateResponseValue which can 
be optionally invoked, specifically to address the case where a provider may be 
enforcing the type-safety, I'd not be surprised if it became the case.
I also introduced a hack to resolve the issue with the out interceptor 
effectively validating the exception mapper response, we can't rely on a status 
because the application code may return Response with the error status and the 
value, so I just added an exchange property. I call it it a hack because when 
JAXRSValidationInInterceptor is run as CXF interceptor the exception which it 
throws is captured by JAXRSInInterceptor#handleFault and converted to Response, 
which causes the side-effect of the out interceptor picking it up; if 
JAXRSFaultOutInterceptor consolidated all the fault processing then it would 
not happen, I'd try and see if it is realistic to fix properly for CXF 3.0.0 
final. That said, if JAXRSValidationInInterceptor is run as JAX-RS 2.0 filter 
then we would still need checking such a property.

Thanks, Sergey 

> Better support for validating the entities wrapped in JAX-RS Response
> ---------------------------------------------------------------------
>
>                 Key: CXF-5401
>                 URL: https://issues.apache.org/jira/browse/CXF-5401
>             Project: CXF
>          Issue Type: Improvement
>            Reporter: Sergey Beryozkin
>         Attachments: patch-response-validation.txt
>
>
> At the moment Response entities can only be validated against the rules 
> attached to the entity properties. Method-level constraints (ex, NotNull) can 
> not be applied yet.
> We need to either offer a support for few well-known constraints (NotNull, 
> Null, etc) or come up with some generic code to get all the available 
> constraints validated



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to