Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B6C417E5C for ; Sun, 10 May 2015 19:48:00 +0000 (UTC) Received: (qmail 80588 invoked by uid 500); 10 May 2015 19:48:00 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 80555 invoked by uid 500); 10 May 2015 19:48:00 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 80410 invoked by uid 99); 10 May 2015 19:48:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 May 2015 19:48:00 +0000 Date: Sun, 10 May 2015 19:48:00 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6396) Media type parameter version not work properly when version not given in Accept header MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)