You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Mike Rheinheimer (JIRA)" <ji...@apache.org> on 2009/07/06 22:57:15 UTC
[jira] Commented: (WINK-47) honor media type wildcards
[ https://issues.apache.org/jira/browse/WINK-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727781#action_12727781 ]
Mike Rheinheimer commented on WINK-47:
--------------------------------------
I didn't explain very well. :) The code path I'm talking about here is the path that does media type matching to find the context resolver. Because the inbound media type parameter that is passed into getContextResolver is treated as a hard-coded string ('*' wildcards are not treated as wildcards), the matching is iffy. For example, if I have a Provider class annotated as such:
@Provider
@Produces(MediaType.APPLICATION_FORM_URLENCODED)
And then call
providers.getContextResolver(MyClass.class, new MediaType("*", "*"));
No match will be found.
> honor media type wildcards
> --------------------------
>
> Key: WINK-47
> URL: https://issues.apache.org/jira/browse/WINK-47
> Project: Wink
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.1
> Reporter: Mike Rheinheimer
> Fix For: 0.1
>
> Attachments: patch.txt
>
>
> This issue probably needs discussion, as it may be a spec interpretation issue. Please reference JAX-RS javadoc for javax.ws.rs.ext.Providers.getContextResolver here:
> http://jackson.codehaus.org/javadoc/jax-rs/1.0/javax/ws/rs/ext/Providers.html#getContextResolver(java.lang.Class,%20javax.ws.rs.core.MediaType)
> Currently, the implementation does not use the '*' character in a passed-in media type as a wildcard. Rather, it matches exactly by just allowing the LinkedHashMap.get to it's object compare. Attached is a patch with tests that demonstrate the proposed function, and a fix that supports it. All existing and new tests in wink-common and wink-server passed for me with this change.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.