olingo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Mansell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OLINGO-1057) Annotations in an Edmx:Reference aren't serialized
Date Sun, 11 Dec 2016 21:29:58 GMT

    [ https://issues.apache.org/jira/browse/OLINGO-1057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15740384#comment-15740384
] 

Mike Mansell commented on OLINGO-1057:
--------------------------------------

No. I was simply trying to set an arbitrary annotation on a Reference (for an internal project,
separate from the example), and found that while the spec allows it, and the Java class allows
it, the Serializer does not. The above was just a contrived example to show the issue.

> 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)

Mime
View raw message