You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Buzzterrier <tj...@blueorigin.com> on 2014/01/09 22:38:32 UTC

JSON issue on jcr:data

When retrieving an entry created by uploading a file, the jcr:data property
on the content node has a preceding colon. 

 "toggle_png_0":{
      "jcr:primaryType":"nt:unstructured",
      "toggle.png":{
         "jcr:createdBy":"admin",
         "jcr:created":"Thu Jan 09 2014 12:53:03 GMT-0800",
         "jcr:primaryType":"nt:file",
         "jcr:content":{
            "jcr:lastModifiedBy":"admin",
            "jcr:mimeType":"image/png",
            "jcr:uuid":"552d0aee-b2a0-4002-966e-738ba58013f0",
            "jcr:lastModified":"Thu Jan 09 2014 12:53:03 GMT-0800",
            "jcr:primaryType":"nt:resource",
            *":jcr:data":22198*
         }
      }
   }



--
View this message in context: http://apache-sling.73963.n3.nabble.com/JSON-issue-on-jcr-data-tp4030138.html
Sent from the Sling - Dev mailing list archive at Nabble.com.

Re: JSON issue on jcr:data

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thu, Jan 9, 2014 at 10:38 PM, Buzzterrier <tj...@blueorigin.com> wrote:
> When retrieving an entry created by uploading a file, the jcr:data property
> on the content node has a preceding colon...

That's by design, as we don't dump the actual data in json, only its
length, we mark it to raise your attention. It worked ;-)

The code is at [1] if you're curious, search for "we dump the length
and not the data".

-Bertrand

[1] http://svn.apache.org/repos/asf/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/JsonObjectCreator.java