jersey
  1. jersey
  2. JERSEY-1337

Boolean Matrix Parameters are interpreted differently from the WADL specification

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.13
    • Fix Version/s: 1.17
    • Component/s: None
    • Labels:
      None

      Description

      As per section http://www.w3.org/Submission/wadl/#x3-130002.6.1 of the WADL specification a boolean matrix parameter is represented either by the presence of absence of the property rather than the =X notation.

      Interestingly the original MatrixURI proposal doesn't have anything to say on the matter:

      http://www.w3.org/DesignIssues/MatrixURIs.html

      This could be a problem with the WADL specification; but if you invoke the following Jersey service:

      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, @MatrixParam("boolean") boolean flag)

      { return param + " " + con + " " + flag; }

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

      { this.con = con; }

      public String getCon()

      { return con; }

      }

      With the URI http://..../matrix;boolean;param=X;con=X then the result is "X X false" rather than the "X X true" as would be expected by the WADL specification.

      I checked and the JSR311 spec doesn't say anything specific on the interpretation of this value.

        Activity

        Hide
        gdavison added a comment -

        Not that UriBuilder is consistent so that

        UriBuilder.fromUri("http://...").matrixParam("boolean", true).build()

        Returns "http://...;boolean=true" and not "http://...;boolean"

        Show
        gdavison added a comment - Not that UriBuilder is consistent so that UriBuilder.fromUri("http://...").matrixParam("boolean", true).build() Returns "http://...;boolean=true" and not "http://...;boolean"
        Hide
        Pavel Bucek added a comment -

        looks like WADL spec issue as you pointed out. I don't think there is anything we should change in Jersey. Closing as won't fix for now, feel free to add comment/reopen.

        Show
        Pavel Bucek added a comment - looks like WADL spec issue as you pointed out. I don't think there is anything we should change in Jersey. Closing as won't fix for now, feel free to add comment/reopen.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: