[JERSEY-1336] WADL for Matrix parameters are in contravention of the WADL specification Created: 02/Aug/12  Updated: 23/Aug/12  Resolved: 23/Aug/12

Status: Resolved
Project: jersey
Component/s: None
Affects Version/s: 1.13
Fix Version/s: 1.14

Type: Bug Priority: Major
Reporter: gdavison Assignee: Pavel Bucek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by Pavel Bucek [ 23/Aug/12 ]

fix submitted to review

Generated at Mon Apr 27 20:43:40 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.