Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3339

Jakarta JAX-RS Resource method parameter with @Valid is executing validation 2 times

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • jaxrs

      Deploying a Web application in WildFly 28.0.0, let's assume the following JAX-RS resource class:
       
      @Path("debug")

      public class DebugResource {

      @POST

      public void create(@Valid User user) {

      ...

      }

      {color:#000000}}

       
      When a POST request is executed, the User parameter is validated twice.
      It seems that Jakarta CDI container, which uses proxies, may be the source
      of this unexpected behavior as, at least, two instances will be created:
      * DebugResource$Proxy$_$$_WeldClientProxy

      • DebugResource$Proxy$_$$_WeldSubclass
         
        Could this be a bug?

              dkafe Dimitris Kafetzis
              zhaiku Haiku Z (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: