Yegor Kozlov created SLING-11892:
------------------------------------

             Summary: Default GET Servlet: Support binary data in JSON Renderer
                 Key: SLING-11892
                 URL: https://issues.apache.org/jira/browse/SLING-11892
             Project: Sling
          Issue Type: Improvement
          Components: Servlets
            Reporter: Yegor Kozlov


The JSON Renderer in the Sling GET Servlet does not export binary properties 
and prints the length instead of the data:
{code:java}
{
  "jcr:primaryType": "nt:resource",
  ":jcr:data": 20127
}
{code}
Note that the names of binary properties are prefixed with a colon.

I would like to introduce an OSGi flag to enable exporting binaries in base64. 
If enabled, the output would look something like
{code:java}
{
  "jcr:primaryType": "nt:resource",
  ":jcr:data": "iVBORw0KGgoA...."
}
{code}
The default is _false_ which means existing consumers will keep getting the 
length.

There is a related ticket https://issues.apache.org/jira/browse/SLING-11891 to 
make sense of the base64 data when importing from JSON.

This change will improve symmetry between export and import in Sling GET/POST 
servlets and make round-trips more reliable.

 

The PR is coming



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to