Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(odata): Fix <Record> example for null value #1356

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions advanced/odata.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,14 @@ Primitive annotation values, meaning Strings, Numbers, `true`, and `false` are m
<Annotation Term="Some.String" String="foo"/>
```

Rendering a `null` value must be done as dynamic expression:
Rendering a `null` value must be done as dynamic expression or as an [annotation expression](#expression-annotations):

```cds
@Some.Null: { $edmJson: { $Null } }
// or
@Some.Null: (null)
```

Both result in the following:
```xml
<Annotation Term="Some.Null">
<Null/>
Expand All @@ -358,7 +360,7 @@ Record-like source structures are mapped to `<Record>` nodes in EDMX, with primi

```cds
@Some.Record: {
Null: null,
Null: (null),
Boolean: true,
Integer: 1,
Number: 3.14,
Expand Down Expand Up @@ -1015,7 +1017,7 @@ The annotation is added to the OData API, as well as the mandatory reference to
</Annotations>
```

The compiler neither evaluates the annotation values nor the URI.
The compiler evaluates neither annotation values nor the URI.
It is your responsibility to make the URI accessible if required.
Unlike for the standard vocabularies listed above, the compiler has no access to the content of
the vocabulary, so the values are translated completely generically.
Expand Down Expand Up @@ -1201,7 +1203,7 @@ The CAP Java SDK exposes all properties annotated with `@Semantics.currencyCode`
* The property's value if it's unique within a group of dimensions
* `null` otherwise

A custom aggregate for a currency code or unit of measure should be also exposed by the `@Aggregation.CustomAggregate` annotation. Moreover, a property for a monetary amount or a measured quantity should be annotated with `@Semantics.amount.currencyCode` or `@Semantics.quantity.unitOfMeasure` to reference the corresponding property that holds the amount's currency code or the quantity's unit of measure, respectively.
A custom aggregate for a currency code or unit of measure should also be exposed by the `@Aggregation.CustomAggregate` annotation. Moreover, a property for a monetary amount or a measured quantity should be annotated with `@Semantics.amount.currencyCode` or `@Semantics.quantity.unitOfMeasure` to reference the corresponding property that holds the amount's currency code or the quantity's unit of measure, respectively.

### Other Features

Expand Down