[
https://issues.apache.org/jira/browse/WINK-56?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12728535#action_12728535
]
Nadav Fischer commented on WINK-56:
-----------------------------------
I too was a bit baffled by this initially but ultimately here's the logic that
guided to this behavior (take a deep breath):
As I understand it, matrix parameters are as their names suggest - parameters.
Their order and even presence is immaterial to the segment identification.
With that being said, it makes sense that a PathParam binding normally means
the segment only without matrix parameters for all types of injectable
parameters, except for the injection of a javax.ws.rs.core.PathSegment in which
case the matrix parameters are available. This makes the behavior clear and
consistent for all cases, whether the injectable parameter is a String or an
Integer.
Another consideration is - what if the method doesn't expect any matrix
parameters on the bound PathParam? We know that matrix parameters are ignored
during matching (in very much the same way that query parameters are ignored).
If a method doesn't expect matrix parameters on the String parameter bound to a
PathParam, and a client, for whatever reason, sends a request that contains
matrix parameters, the method will be invoked because of a successful match,
but things can go very wrong inside the method if we provide the path param
along with the matrix parameters.
phew, that was long...
What do you think?
> Matrix parameters not included on String parameter with @PathParam annotation
> -----------------------------------------------------------------------------
>
> Key: WINK-56
> URL: https://issues.apache.org/jira/browse/WINK-56
> Project: Wink
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.1
> Reporter: Jesse Ramos
> Priority: Minor
>
> Opening this bug to begin some discussion on a difference between the IBM
> implementation on the Symphony implementation when it comes to matrix
> parameters. In the IBM runtime, we were including the matrix parameters when
> injecting String parameter values that had the @PathParam annotation.
> Here's an example method header:
> {code}
> @Path("matrix/{loc}")
> @GET
> public String helloPath(@PathParam("loc") String path, @PathParam("loc")
> PathSegment pathSegment,
> @MatrixParam("mp") String matrix
> ) {...}
> {code}
> In this case the first parameter named "path" is injected with the matrix
> parameters in the value. In Symphony, it seems the matrix parameters are
> excluded. This is causing some integration tests that are being ported over
> to fail.
> I couldn't find anything in the spec or documentation that says it should be
> one way or the other. Any thoughts on what the behavior for this should be?
> If we need to change any code, we can do so with this bug report.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.