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

Status: Closed
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


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


But if you run this trivial example:

package project1;

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

public class MatrixExample {

private String con;

public MatrixExample() {

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

{ return param + " " + 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: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:param name="param" style="matrix" xmlns:ns3="http://www.w3.org/2001/XMLSchema" type="ns3:string"/>
<ns0:representation mediaType="/"/>

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.

Comment by Pavel Bucek [ 23/Aug/12 ]

fix submitted to review

Generated at Tue Jan 24 21:32:50 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.