[
https://issues.apache.org/jira/browse/CXF-3483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028150#comment-13028150
]
Sergey Beryozkin commented on CXF-3483:
---------------------------------------
Hi, I have only a single test testing this property.
Here is a top-level class:
{code}
@XmlRootElement(name = "tagholder", namespace = "http://tags")
public static class TagVO2Holder {
@XmlElement(name = "thetag", namespace = "http://tags")
private TagVO2 t;
@XmlAttribute
private String attr = "attribute";
public void setTag(TagVO2 tag) {
this.t = tag;
}
public TagVO2 getTagValue() {
return t;
}
public String getAttribute() {
return attr;
}
}
{code}
TagVO2 class is here:
http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO2.java
it extends TagVO:
http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TagVO.java
When this property is set, the following is produced:
{"ns1.tagholder":{"attr":"attribute","ns1.thetag":{"group":"B","name":"A"}}}
or
{"tagholder":{"attr":"attribute","thetag":{"group":"B","name":"A"}}}
if namespaces are ignored.
Without setting this property I can see
{"tagholder":{"@attr":"attribute","thetag":{"group":"B","name":"A"}}}
It is likely that the custom writer fails to deal with converting attributes to
elements in your case...
Can you please provide a sample JAXB bean and show what sequence is produced
now (without setting the property) ?
That will help with making sure that one way or another (either via
attributesToElements or Jettison configuration) we can get attributes handled
correctly
> JSONProvider: Don't force attributes to have @ if users doesn't want them too
> -----------------------------------------------------------------------------
>
> Key: CXF-3483
> URL: https://issues.apache.org/jira/browse/CXF-3483
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS
> Affects Versions: 2.3.4
> Reporter: Pat Turner
>
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira