mirror of
https://github.com/apache/olingo-odata4.git
synced 2025-02-06 18:18:55 +00:00
OLINGO-1230: adding missing OpenType attribute to complex and entity type in metadata document
This commit is contained in:
parent
c2c5111a62
commit
d0f52977e6
@ -139,6 +139,7 @@ public class MetadataDocumentXmlSerializer {
|
|||||||
private static final String ABSTRACT = "Abstract";
|
private static final String ABSTRACT = "Abstract";
|
||||||
|
|
||||||
private static final String XML_ANNOTATIONS = "Annotations";
|
private static final String XML_ANNOTATIONS = "Annotations";
|
||||||
|
private static final String OPEN_TYPE = "OpenType";
|
||||||
|
|
||||||
private static final String EDMX = "Edmx";
|
private static final String EDMX = "Edmx";
|
||||||
private static final String PREFIX_EDMX = "edmx";
|
private static final String PREFIX_EDMX = "edmx";
|
||||||
@ -772,7 +773,11 @@ public class MetadataDocumentXmlSerializer {
|
|||||||
if (complexType.isAbstract()) {
|
if (complexType.isAbstract()) {
|
||||||
writer.writeAttribute(ABSTRACT, TRUE);
|
writer.writeAttribute(ABSTRACT, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (complexType.isOpenType()) {
|
||||||
|
writer.writeAttribute(OPEN_TYPE, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
appendProperties(writer, complexType);
|
appendProperties(writer, complexType);
|
||||||
|
|
||||||
appendNavigationProperties(writer, complexType);
|
appendNavigationProperties(writer, complexType);
|
||||||
@ -801,6 +806,10 @@ public class MetadataDocumentXmlSerializer {
|
|||||||
writer.writeAttribute(ABSTRACT, TRUE);
|
writer.writeAttribute(ABSTRACT, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entityType.isOpenType()) {
|
||||||
|
writer.writeAttribute(OPEN_TYPE, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
appendKey(writer, entityType);
|
appendKey(writer, entityType);
|
||||||
|
|
||||||
appendProperties(writer, entityType);
|
appendProperties(writer, entityType);
|
||||||
|
@ -450,7 +450,7 @@ public class MetadataDocumentXmlSerializerTest {
|
|||||||
|
|
||||||
InputStream metadataStream = serializer.metadataDocument(serviceMetadata).getContent();
|
InputStream metadataStream = serializer.metadataDocument(serviceMetadata).getContent();
|
||||||
String metadata = IOUtils.toString(metadataStream);
|
String metadata = IOUtils.toString(metadataStream);
|
||||||
assertTrue(metadata.contains("<ComplexType Name=\"ComplexType\" Abstract=\"true\">"
|
assertTrue(metadata.contains("<ComplexType Name=\"ComplexType\" Abstract=\"true\" OpenType=\"true\">"
|
||||||
+ "<Property Name=\"prop1\" Type=\"Edm.String\"/>"
|
+ "<Property Name=\"prop1\" Type=\"Edm.String\"/>"
|
||||||
+ "<Property Name=\"prop2\" Type=\"Edm.String\"/>"
|
+ "<Property Name=\"prop2\" Type=\"Edm.String\"/>"
|
||||||
+ "</ComplexType>"));
|
+ "</ComplexType>"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user