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

Christian Amend resolved OLINGO-310.
------------------------------------

    Resolution: Fixed

Use omitJsonWrapper at EntityProviderWriteProperties

> JSON request is always wrapped in object with "d" property only, even for 
> requests
> ----------------------------------------------------------------------------------
>
>                 Key: OLINGO-310
>                 URL: https://issues.apache.org/jira/browse/OLINGO-310
>             Project: Olingo
>          Issue Type: Sub-task
>    Affects Versions: V2 1.2.0
>            Reporter: Hristo Borisov
>            Assignee: Christian Amend
>            Priority: Critical
>             Fix For: V2 1.3.0
>
>
> I am trying to send a POST request with OData JSON object.
> I am following the example application found here:
> http://olingo.apache.org/doc/tutorials/OlingoV2BasicClientSample.html
> What I noticed is that whenever I execute the following line:
> ODataResponse response = EntityProvider.writeEntry("application/json", 
> entitySet, data, properties);
> the response is wrapped in another object with one property only - "d"
> I know that this is to prevent XSS vulnerabilities but I think that it should 
> be added only in outputs. In this case I am generating request which I send 
> to the target API.
> I think that the problem is in the:
> JsonEntryEntityProducer.java in the method append.
> there is a check:
> jsonStreamWriter = new JsonStreamWriter(writer);
>       if (isRootElement) {
>         jsonStreamWriter.beginObject().name(FormatJson.D);
>       }
> which adds the d propertyi always. I think this should be somehow 
> configurable.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to