jersey
  1. jersey
  2. JERSEY-1336

WADL for Matrix parameters are in contravention of the WADL specification

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.13
    • Fix Version/s: 1.14
    • Component/s: None
    • Labels:
      None

      Description

      Section 2.12 of the WADL specification states that a matrix parameter can only exist on a resource element:

      http://www.w3.org/Submission/wadl/#x3-250002.12

      But if you run this trivial example:

      package project1;

      import javax.ws.rs.GET;
      import javax.ws.rs.MatrixParam;
      import javax.ws.rs.Path;

      @Path("/matrix")
      public class MatrixExample {

      private String con;

      public MatrixExample() {
      }

      @GET
      public String matrixExample(@MatrixParam("param") String param)

      { return param + " " + con; }

      @MatrixParam("con")
      public void setCon(String con)

      { this.con = con; }

      public String getCon()

      { return con; }

      }

      Then you end up with the following WADL which is in contravention of the specification:

      <?xml version="1.0" encoding="UTF-8"?>
      <ns0:application xmlns:ns0="http://wadl.dev.java.net/2009/02">
      <ns0:doc xmlns:ns1="http://jersey.java.net/" ns1:generatedBy="Jersey: 1.13-b01 03/09/2012 03:52 PM"/>
      <ns0:grammars/>
      <ns0:resources base="http://localhost:7101/Application1-Project1-context-root/resources/">
      <ns0:resource path="/matrix">
      <ns0:param name="con" style="matrix" xmlns:ns2="http://www.w3.org/2001/XMLSchema" type="ns2:string"/>
      <ns0:method id="matrixExample" name="GET">
      <ns0:request>
      <ns0:param name="param" style="matrix" xmlns:ns3="http://www.w3.org/2001/XMLSchema" type="ns3:string"/>
      </ns0:request>
      <ns0:response>
      <ns0:representation mediaType="/"/>
      </ns0:response>
      </ns0:method>
      </ns0:resource>
      </ns0:resources>
      </ns0:application>

      The second matrix parameter should be added at the resource level, this shouldn't be a problem for other methods as parameter are optional by default.

        Activity

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            gdavison
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: