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

Praveer Gupta edited comment on CXF-3475 at 4/27/11 4:57 PM:
-------------------------------------------------------------

How should the map be provided to the inTransformElements when there are more 
than one namespaces in the JSON output that had been removed.

For example: consider the JSON String {"book.book":{"book.element1":"value1", 
"book.element2":{"name.element3":"value3"}}}.

In the above case there are two namespaces, 'book' and 'name'.

If ignoreNamespaces is true, the output becomes {"book":{"element1":"value1", 
"element2":{"element3":"value3"}}}

Map has to be provided to the inTransformElements for both 'book' and 'name'. 
According to me, for both these namespaces the key becomes "", which doesn't 
make sense.

Eg:

<property name="inTransformElements" >
   <map>
        <entry key="" value="book" />
        <entry key="" value="name" />
   </map>
</property>

Is there some other way this has to be configured (the above configuration 
doesn't work).

      was (Author: praveer09):
    How should the map be provided to the inTransformElements when there are 
more than one namespaces in the JSON output that had been removed.

For example: consider the JSON String {"book.book":{"book.element1":"value1", 
"book.element2":{"name.element3":"value3"}}}.

In the above case there are two namespaces, 'book' and 'name'.

If ignoreNamespaces is true, the output becomes {"book":{"element1":"value1", 
"element2":{"element3":"value3"}}}

Map has to be provided to the inTransformElements for both 'book' and 'name'. 
According to me, for both these namespaces the key becomes "", which doesn't 
make sense.

Eg:

<property name="inTransformElements" >
   <map>
        <entry key="" value="book" />
        <entry key="" value="name" />
   </map>
</property>

Is there some other way this has to be configured.
  
> JSONProvider not able to unmarshall JSON string without namespaces
> ------------------------------------------------------------------
>
>                 Key: CXF-3475
>                 URL: https://issues.apache.org/jira/browse/CXF-3475
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, JAXB Databinding
>    Affects Versions: 2.4
>            Reporter: Praveer Gupta
>            Assignee: Sergey Beryozkin
>
> If a JSON String is generated by org.apache.cxf.jaxrs.provider.JSONProvider 
> using the attributes ignoreNamespaces and attributesToElements as true, the 
> JSONProvider is not able to unmarshall the same JSON string back to the Java 
> object from which it was generated. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to