cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastien Lorber (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-4498) Default Jettison JSONProvider: @ for element attributes in JSON
Date Wed, 05 Sep 2012 14:14:07 GMT

    [ https://issues.apache.org/jira/browse/CXF-4498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448763#comment-13448763
] 

Sebastien Lorber commented on CXF-4498:
---------------------------------------

Hi.

Sorry for the JIRA it seems it will work, i didn't notice that attributesToElements was mapped
to the setSupressAtAttributes of config...
                
> 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

Mime
View raw message