You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Amend (JIRA)" <ji...@apache.org> on 2014/07/18 08:24:06 UTC

[jira] [Closed] (OLINGO-310) JSON request is always wrapped in object with "d" property only, even for requests

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

Christian Amend closed OLINGO-310.
----------------------------------


> 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 2.0.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)