-
Notifications
You must be signed in to change notification settings - Fork 99
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
Conversation
Due to annotation flattening, the value `null` would _not_ be rendered as `<Null/>` in OData EDMX. Instead, as the section before that mentions, we need to use special `$edmJson` syntax.
advanced/odata.md
Outdated
@@ -360,7 +360,7 @@ Record-like source structures are mapped to `<Record>` nodes in EDMX, with primi | |||
|
|||
```cds | |||
@Some.Record: { | |||
Null: null, | |||
Null: { $edmJson: { $Null } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is special handling of record-annotation-types, I stand corrected. However, due to annotation flattening, such entries wouldn't be propagated properly anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that's wrong especially as a couple of lines @Some.Null
explains how it should be. However, all this was written before we had this:
@UI.rec: { Null: (null) }
renders into:
<Annotation Term="UI.rec">
<Record>
<PropertyValue Property="Null">
<Null/>
</PropertyValue>
</Record>
</Annotation>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, thanks for reminding me! 😄
I've updated the sections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, you probably want to rewrite the null anno with expression syntax?
Due to annotation flattening, the value
null
would not be rendered as<Null/>
in OData EDMX. Instead, as the section before that mentions, we need to use special$edmJson
syntax or the new expression syntax(null)
.Tested with cds-compiler v5.3.2