[ https://issues.apache.org/jira/browse/CXF-4498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebastien Lorber updated CXF-4498: ---------------------------------- Description: 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 was: 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 an alternative solution by subclassing the JSONProvider. > 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 > Fix For: 2.4.1, 2.3.5 > > > 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