Search

Service Protocols

OData

OData Annotations

CDS applies a generic, isomorphic approach, with names and positions of annotations exactly as specified in the OData Vocabularies, and defaults for mapping literal types to respective property entries.

For example:

@UI.LineItem:[
  {Value:foo, Label:'Fooo'},
  {Value:bar}
]

… translates into this EDMX:

<Annotation Term="UI.LineItem">
  <Collection>
    <Record Type="UI.DataField">
      <PropertyValue Property="Value" Path="foo"/>
      <PropertyValue Property="Label" String="Fooo"/>
    </Record>
    <Record Type="UI.DataField">
      <PropertyValue Property="Value" Path="bar"/>
    </Record>
  </Collection>
</Annotation>

The mapping is aware of OData Vocabularies, which allows to omit properties based on defaults, for example, the record types above. You can add them, if required. For example, the above can also be written with explicitly specified record types:

@UI.LineItem:[
  {$Type:'UI.DataField', Value:foo, Label:'Fooo'},
  {$Type:'UI.DataField', Value:bar}
]

learn more on OData Annotations in CDS

REST

GraphQL

Custom Protocols