Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1142

[OData Client] - Referenced metadata documents are not parsed recursively

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • odata4-client
    • None

    Description

      Let's say there is a service metadata document as follows

      <edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
         <edmx:Reference Uri="http://vocabularies.odata.org/OData.Community.Display.V1.xml">
          <edmx:Include Namespace="OData.Community.Display.V1" Alias="Display" />
          <edmx:IncludeAnnotations TermNamespace="OData.Community.Display.V1" />
        </edmx:Reference>
        <edmx:DataServices>
          <Schema Namespace="some.namespace" Alias="mscrm" xmlns="http://docs.oasis-open.org/odata/ns/edm">
           ....
           </Schema>
        <edmx:DataServices>
      </edmx:Edmx>
      

      The referenced document http://vocabularies.odata.org/OData.Community.Display.V1.xml in the above metadata document includes another document

      <edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
        <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/os/vocabularies/Org.OData.Core.V1.xml">
          <edmx:Include Alias="Core" Namespace="Org.OData.Core.V1"/>
        </edmx:Reference>
        <edmx:DataServices>
          <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OData.Community.Display.V1">
           ...
          </Schema>
        </edmx:DataServices>
      </edmx:Edmx>
      

      According to OData spec(http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part3-csdl/odata-v4.0-errata03-os-part3-csdl-complete.html#_Toc453752504)

      The scope of a CSDL document is the document itself and all schemas included from directly referenced documents. All entity types, complex types and other named elements in scope (that is, defined in the document itself or a schema of a directly referenced document) can be accessed from a referencing document by their namespace-qualified names.

      So, one should be able to use types or annotations defined in Org.OData.Core.V1 namespace in the original metadata document. The XMLMetadataRequestImpl only adds the things defined in the directly referenced metadata document to the returned metadata. So annotation defined in Org.OData.Core.V1 are not available in Edm.

      Attachments

        Activity

          People

            Unassigned Unassigned
            susharm Sumit
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: