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 XML_ANNOTATIONS = "Annotations";
|
||||
private static final String OPEN_TYPE = "OpenType";
|
||||
|
||||
private static final String EDMX = "Edmx";
|
||||
private static final String PREFIX_EDMX = "edmx";
|
||||
@ -773,6 +774,10 @@ public class MetadataDocumentXmlSerializer {
|
||||
writer.writeAttribute(ABSTRACT, TRUE);
|
||||
}
|
||||
|
||||
if (complexType.isOpenType()) {
|
||||
writer.writeAttribute(OPEN_TYPE, TRUE);
|
||||
}
|
||||
|
||||
appendProperties(writer, complexType);
|
||||
|
||||
appendNavigationProperties(writer, complexType);
|
||||
@ -801,6 +806,10 @@ public class MetadataDocumentXmlSerializer {
|
||||
writer.writeAttribute(ABSTRACT, TRUE);
|
||||
}
|
||||
|
||||
if (entityType.isOpenType()) {
|
||||
writer.writeAttribute(OPEN_TYPE, TRUE);
|
||||
}
|
||||
|
||||
appendKey(writer, entityType);
|
||||
|
||||
appendProperties(writer, entityType);
|
||||
|
@ -450,7 +450,7 @@ public class MetadataDocumentXmlSerializerTest {
|
||||
|
||||
InputStream metadataStream = serializer.metadataDocument(serviceMetadata).getContent();
|
||||
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=\"prop2\" Type=\"Edm.String\"/>"
|
||||
+ "</ComplexType>"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user