[resteasy-dev] Disable validation for individual requests

Christian Kaltepoth christian at kaltepoth.de
Tue Mar 6 09:40:32 EST 2018


Hey all,

I'm currently working on Ozark, which is the reference implementation for
JSR-371 (MVC 1.0). My current focus is to improve the integration between
Ozark and RESTEasy.

The MVC specification has some special requirements regarding validation.
Especially it requires that resource methods (called controller methods in
MVC) get executed even if validation errors were detected according to the
Bean Validation annotation places on resource properties and resource
method parameters. This is required so that the controller can handle these
errors, which most typically varies between pages.

To achieve this, Ozark currently implements a custom validation layer
without relying on the native JAX-RS validation which (by design) aborts
request processing as soon as validation errors are detected. This
basically works fine, but it currently forces users to manually disable the
native JAX-RS validation by annotating controllers with
@ValidateOnExecution(NONE). Of course this isn't very user friendly, so I'm
looking for ways to work around this.

So I'm looking for ways to disable the validation on a per request basis.
It is important to do this only for individual requests because this
behavior most only be applied if the request is processed by a MVC
controller. Regular JAX-RS resources must not be affected by this.

Of course I would love to find a way to make this work with current
RESTEasy versions. But I would also be happy to contribute code if you
think that some kind of SPI makes sense.

Christian


-- 
Christian Kaltepoth
Blog: http://blog.kaltepoth.de/
Twitter: http://twitter.com/chkal
GitHub: https://github.com/chkal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/resteasy-dev/attachments/20180306/140ac3ad/attachment.html 


More information about the resteasy-dev mailing list