[
https://issues.apache.org/jira/browse/CXF-6396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14537329#comment-14537329
]
Sergey Beryozkin commented on CXF-6396:
---------------------------------------
You can add a pre-matching ContainerRequestFilter and set a new MediaType with
the preferred parameter if it is missing in the incoming header
> Media type parameter version not work properly when version not given in
> Accept header
> --------------------------------------------------------------------------------------
>
> Key: CXF-6396
> URL: https://issues.apache.org/jira/browse/CXF-6396
> Project: CXF
> Issue Type: Bug
> Affects Versions: 3.1.0
> Reporter: Dominik Przybysz
> Assignee: Sergey Beryozkin
>
> I have created a following JAX-RS webservice with operations
> @GET
> @Produces("application/vnd.test+json; version=1")
> public String getV1() {
> return "{'v':'v1'}";
> }
> @GET
> @Produces("application/vnd.test+json; version=2")
> public String getV2() {
> return "{'v':'v2'}";
> }
> When I set Accept header to "application/vnd.test+json; version=2" then I
> receive {'v':'v2'} and it is ok.
> When I set Accept header to "application/vnd.test+json; version=1" then I
> receive {'v':'v1'} and it is ok.
> When I set Accept header to "application/vnd.test+json" then I receive
> {'v':'v1'} and it is not ok, because I should receive the most recent version.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)