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 369E2D5AE for ; Wed, 5 Sep 2012 14:06:09 +0000 (UTC) Received: (qmail 73993 invoked by uid 500); 5 Sep 2012 14:06:08 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 73930 invoked by uid 500); 5 Sep 2012 14:06:07 -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 73847 invoked by uid 99); 5 Sep 2012 14:06:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 14:06:07 +0000 Date: Thu, 6 Sep 2012 01:06:07 +1100 (NCT) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: <91130691.39047.1346853967902.JavaMail.jiratomcat@arcas> In-Reply-To: <1592551605.38544.1346849587573.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CXF-4498) Default Jettison JSONProvider: @ for element attributes in JSON 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-4498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448759#comment-13448759 ] Sergey Beryozkin commented on CXF-4498: --------------------------------------- Hi, can you try an 'attributesToElements' property ? It is meant for suppressing '@' signs > Default Jettison JSONProvider: @ for element attributes in JSON > --------------------------------------------------------------- > > Key: CXF-4498 > URL: https://issues.apache.org/jira/browse/CXF-4498 > Project: CXF > Issue Type: Improvement > Components: JAX-RS > Affects Versions: 2.3.4 > Reporter: Sebastien Lorber > Assignee: Sergey Beryozkin > Priority: Trivial > Fix For: 2.4.1, 2.3.5 > > Original Estimate: 10m > Remaining Estimate: 10m > > Initial description: > Jettison provides a configuration option to omit the '@' from attributes: > org.codehaus.jettison.mapped.Configuration.setSupressAtAttributes(boolean) > see Jettison Jira: > http://jira.codehaus.org/browse/JETTISON-2 > org.apache.cxf.jaxrs.provider.JSONProvider should also expose this property. > -------------------------------------------------------------------------------- > My additional comments: > I think the original issue is not fixed. > There is a solution by subclassing the JSONProvider like Sergey Beryozkin said > " > Sergey Beryozkin added a comment - 03/May/11 14:05 > What you may want to do is to register a custom JSONProvider provider which overrides its createWriter method (copy the code from the parent method and set suppressAtAttributes property on Configuration). May be it will help ? > " > But in reality we can't override the createWriter method just do add the simple line: > config.setSupressAtAttributes(true); //MODIFIED > Because the original createWriter method is using a lot of private attributes in the original class, which are not accessible in the subclass, even by a getter. > The only solution i had was to copy the original class and add a single line. > It is not for many reasons like: if i update my CXF lib version, i will have to report the JSONProvider updates in my copy, or keep my outdated copy. > I think a boolean setter should be set in the org.apache.cxf.jaxrs.provider.JSONProvider so that we can tell to JSONProvider if we want to use the config.setSupressAtAttributes(true). > Thanks -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira