You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "James M Snell (JIRA)" <ji...@apache.org> on 2007/05/25 00:32:16 UTC

[jira] Resolved: (ABDERA-48) JSON Content Writing

     [ https://issues.apache.org/jira/browse/ABDERA-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James M Snell resolved ABDERA-48.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.3.0

Fix committed.

> JSON Content Writing
> --------------------
>
>                 Key: ABDERA-48
>                 URL: https://issues.apache.org/jira/browse/ABDERA-48
>             Project: Abdera
>          Issue Type: Bug
>            Reporter: Wing Yung
>            Priority: Minor
>             Fix For: 0.3.0
>
>
> The Abdera JSONWriter is adding an extra set of quotation marks around entry content values.
>     	Entry e = abderaFactory.newEntry();
>     	e.setContent("some content", Content.Type.TEXT);
>     	JSONObject obj = JSONWriter.toJSON(e);
> => 
> { ... "content":{"value":"\"some content\"","type":"text"}," ... }
> Around line 143 of org.apache.abdera.ext.json.JSONWriter:
> jscontent.put("value", JSONObject.quote(content.getValue()));
> The JSONObject.quote method adds the quotation marks (in addition to inserting '\'s into the content). A possible fix would be to strip the surrounding quotation marks off the output of JSONObject.quote since we'd still like it to escape special characters in the content.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.