abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wing Yung (JIRA)" <j...@apache.org>
Subject [jira] Created: (ABDERA-48) JSON Content Writing
Date Thu, 24 May 2007 18:30:16 GMT
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

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.

View raw message