You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Torkian (JIRA)" <ji...@apache.org> on 2014/12/19 09:56:13 UTC

[jira] [Comment Edited] (CXF-6166) Parsing Bug in org.apache.cxf.jaxrs.provider.json.JsonMapObjectReaderWriter

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

Daniel Torkian edited comment on CXF-6166 at 12/19/14 8:55 AM:
---------------------------------------------------------------

Hi again,
please look at the following code snippets:
{code:java}
JsonMapObjectReaderWriter jmo = new JsonMapObjectReaderWriter();
Map<String, Object> data = jmo.fromJson("{\"integer\":24,\"nullKey\":null}");
System.out.println(jmo.toJson(data));
{code}

the following is the output in the console:
{code}
{"integer":"24","nullKey":"null"}
{code}

Integer and null are converted to string. 
The correct output should be:
{code}
{"integer":24,"nullKey":null}
{code}


was (Author: dtorkian):
Hi again,
please look at the following code snippets:
{code:java}
JsonMapObjectReaderWriter jmo = new JsonMapObjectReaderWriter();
Map<String, Object> data = jmo.fromJson(new String("{\"integer\":24,\"nullKey\":null}".getBytes()));
System.out.println(jmo.toJson(data));
{code}

the following is the output in the console:
{code}
{"integer":"24","nullKey":"null"}
{code}

Integer and null are converted to string. 
The correct output should be:
{code}
{"integer":24,"nullKey":null}
{code}

> Parsing Bug in org.apache.cxf.jaxrs.provider.json.JsonMapObjectReaderWriter
> ---------------------------------------------------------------------------
>
>                 Key: CXF-6166
>                 URL: https://issues.apache.org/jira/browse/CXF-6166
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.3, 3.0.4, 3.1.0
>            Reporter: Daniel Torkian
>            Priority: Minor
>              Labels: JAXRS, JSON, Parsing
>         Attachments: bugJsonMapObjectReaderWriter.txt
>
>
> Parsing Bug in org.apache.cxf.jaxrs.provider.json.JsonMapObjectReaderWriter.
> See Patch



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)