Hristo Borisov created OLINGO-310:
-------------------------------------
Summary: 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: Bug
Affects Versions: V2 1.2.0
Reporter: Hristo Borisov
Priority: Critical
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/atom+xml",
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 add only in outputs. In this case I am generating requests 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)