Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-17801

JAX-RS validation: Bogus warning for parameter whose type is an enumeration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.2.0.CR1
    • 4.2.0.Beta2
    • webservices
    • None
    • Hide

      The problem can be reproduced with the code below:

      @javax.ws.rs.Path("hello")
      public class HelloWorld {
          @javax.ws.rs.GET
          public String getMessage(@javax.ws.rs.QueryParam("type") MessageType type) {
              return "foo";
          }
      	
          public enum MessageType { A, B }
      }
      
      Show
      The problem can be reproduced with the code below: @javax.ws.rs.Path( "hello" ) public class HelloWorld { @javax.ws.rs.GET public String getMessage(@javax.ws.rs.QueryParam( "type" ) MessageType type) { return "foo" ; } public enum MessageType { A, B } }

      The JAX-RS validation wrongly complains about the type of the parameter when it is an enumeration defined in the same class of the resource.

      "The type 'Resources.InstanceType' is not valid for this parameter. See JAX-RS 2.0 Specification (section 3.2) for more information."

      (the error message just telling that something is invalid doesn't help too much either when you are trying to understand how the validation is reasoning)

            xcoulon@redhat.com Xavier Coulon
            clovisseragiotto_jira Clovis Seragiotto (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: