Mike Mansell created OLINGO-1057:
------------------------------------

             Summary: Annotations in an Edmx:Reference aren't serialized
                 Key: OLINGO-1057
                 URL: https://issues.apache.org/jira/browse/OLINGO-1057
             Project: Olingo
          Issue Type: Bug
          Components: odata4-server
    Affects Versions: (Java) V4 4.3.0
            Reporter: Mike Mansell
            Priority: Minor


According to the CSDL Spec v4.0 section 3.3, it's valid to have annotations 
within an Edmx:Reference element. The underlying EdmxReference Java class does 
support setting an CsdlAnnotation. However, the MetadataDocumentXmlSerializer 
does not write them out.

{code:title=Test.java|borderstyle=solid}
EdmxReference ref = new EdmxReference(new 
URI("http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/vocabularies/Org.OData.Core.V1.xml";));
ref.addInclude(new EdmxReferenceInclude("Org.OData.Core.V1", "Core"));

CsdlAnnotation anno = new CsdlAnnotation();
anno.setTerm("Core.Description");
anno.setExpression(new CsdlConstantExpression(ConstantExpressionType.String, 
"Sample Annotation"));

ref.setAnnotations(Collections.singletonList(anno));
{code}

I would expect to see something like:

{code:title=ExpectedMetaData.xml|borderStyle=solid}
<edmx:Reference 
Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/vocabularies/Org.OData.Core.V1.xml";>
        <edmx:Include Alias="Core" Namespace="Org.OData.Core.V1" />
        <Annotation xmlns="http://docs.oasis-open.org/odata/ns/edm"; 
Term="Core.Description">
            <String>Sample Annotation</String>
        </Annotation>
</edmx:Reference>
{code}

Instead, I just get:


{code:title=ExpectedMetaData.xml|borderStyle=solid}
<edmx:Reference 
Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/vocabularies/Org.OData.Core.V1.xml";>
        <edmx:Include Alias="Core" Namespace="Org.OData.Core.V1" />
</edmx:Reference>
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to