OLINGO-977: Adding the XML declaration to the response of Complex Collection
This commit is contained in:
parent
68d2e23ad4
commit
aa8f2cfc2f
|
@ -1081,7 +1081,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
|
||||||
CircleStreamBuffer buffer = new CircleStreamBuffer();
|
CircleStreamBuffer buffer = new CircleStreamBuffer();
|
||||||
outputStream = buffer.getOutputStream();
|
outputStream = buffer.getOutputStream();
|
||||||
XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStream, DEFAULT_CHARSET);
|
XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStream, DEFAULT_CHARSET);
|
||||||
|
writer.writeStartDocument(DEFAULT_CHARSET, "1.0");
|
||||||
writer.writeStartElement(METADATA, Constants.VALUE, NS_METADATA);
|
writer.writeStartElement(METADATA, Constants.VALUE, NS_METADATA);
|
||||||
writer.writeNamespace(METADATA, NS_METADATA);
|
writer.writeNamespace(METADATA, NS_METADATA);
|
||||||
writer.writeNamespace(DATA, NS_DATA);
|
writer.writeNamespace(DATA, NS_DATA);
|
||||||
|
|
|
@ -2175,7 +2175,8 @@ public class ODataXmlSerializerTest {
|
||||||
.entitySet(edmEntitySet).keyPath("32767").navOrPropertyPath(edmProperty.getName())
|
.entitySet(edmEntitySet).keyPath("32767").navOrPropertyPath(edmProperty.getName())
|
||||||
.build())
|
.build())
|
||||||
.build()).getContent());
|
.build()).getContent());
|
||||||
String expected = "<m:value xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n" +
|
String expected = "<?xml version='1.0' encoding='UTF-8'?>\n"
|
||||||
|
+ "<m:value xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n" +
|
||||||
" xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\" "
|
" xmlns:d=\"http://docs.oasis-open.org/odata/ns/data\" "
|
||||||
+ "m:type=\"#Collection(olingo.odata.test1.CTTwoPrim)\"\n" +
|
+ "m:type=\"#Collection(olingo.odata.test1.CTTwoPrim)\"\n" +
|
||||||
" m:context=\"$metadata#ESMixPrimCollComp(32767)/CollPropertyComp\"\n" +
|
" m:context=\"$metadata#ESMixPrimCollComp(32767)/CollPropertyComp\"\n" +
|
||||||
|
|
Loading…
Reference in New Issue