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

ODATA-1397 #61

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
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
60 changes: 32 additions & 28 deletions docs/odata-csdl-json/odata-csdl-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -3201,34 +3201,38 @@ <h3 id="14412-record"><a name="Record" href="#Record">14.4.12 Record</a></h3>
</div>
<div class="varjson example">
<p>Example 87: this annotation “morphs” the entity type from <a href="#entitytype">example 13</a> into a structured type with two structural properties <code>GivenName</code> and <code>Surname</code> and two navigation properties <code>DirectSupervisor</code> and <code>CostCenter</code>. The first three properties simply rename properties of the annotated entity type, the fourth adds a calculated navigation property that is pointing to a different service</p>
<div class="sourceCode" id="cb95"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb95-1"><a href="#cb95-1" aria-hidden="true" tabindex="-1"></a><span class="er">&quot;@person.Employee&quot;:</span> <span class="fu">{</span></span>
<span id="cb95-2"><a href="#cb95-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@type&quot;</span><span class="fu">:</span> <span class="st">&quot;https://example.org/vocabs/person#org.example.person.Manager&quot;</span><span class="fu">,</span></span>
<span id="cb95-3"><a href="#cb95-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@Core.Description&quot;</span><span class="fu">:</span> <span class="st">&quot;Annotation on record&quot;</span><span class="fu">,</span></span>
<span id="cb95-4"><a href="#cb95-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;GivenName&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-5"><a href="#cb95-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;FirstName&quot;</span></span>
<span id="cb95-6"><a href="#cb95-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb95-7"><a href="#cb95-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;[email protected]&quot;</span><span class="fu">:</span> <span class="st">&quot;Annotation on record member&quot;</span><span class="fu">,</span></span>
<span id="cb95-8"><a href="#cb95-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Surname&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-9"><a href="#cb95-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;LastName&quot;</span></span>
<span id="cb95-10"><a href="#cb95-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb95-11"><a href="#cb95-11" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;DirectSupervisor&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-12"><a href="#cb95-12" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;Manager&quot;</span></span>
<span id="cb95-13"><a href="#cb95-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb95-14"><a href="#cb95-14" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;CostCenter&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-15"><a href="#cb95-15" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$UrlRef&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-16"><a href="#cb95-16" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Apply&quot;</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb95-17"><a href="#cb95-17" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;http://host/anotherservice/CostCenters(&#39;{ccid}&#39;)&quot;</span><span class="ot">,</span></span>
<span id="cb95-18"><a href="#cb95-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span></span>
<span id="cb95-19"><a href="#cb95-19" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$LabeledElement&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-20"><a href="#cb95-20" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;CostCenterID&quot;</span></span>
<span id="cb95-21"><a href="#cb95-21" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb95-22"><a href="#cb95-22" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Name&quot;</span><span class="fu">:</span> <span class="st">&quot;ccid&quot;</span></span>
<span id="cb95-23"><a href="#cb95-23" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb95-24"><a href="#cb95-24" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span><span class="fu">,</span></span>
<span id="cb95-25"><a href="#cb95-25" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Function&quot;</span><span class="fu">:</span> <span class="st">&quot;odata.fillUriTemplate&quot;</span></span>
<span id="cb95-26"><a href="#cb95-26" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb95-27"><a href="#cb95-27" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb95-28"><a href="#cb95-28" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
<div class="sourceCode" id="cb95"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb95-1"><a href="#cb95-1" aria-hidden="true" tabindex="-1"></a><span class="er">&quot;$Annotations&quot;:</span> <span class="fu">{</span></span>
<span id="cb95-2"><a href="#cb95-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;org.example.Person&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-3"><a href="#cb95-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@org.example.hcm.Employee&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-4"><a href="#cb95-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@type&quot;</span><span class="fu">:</span> <span class="st">&quot;https://example.org/vocabs/person#org.example.person.Manager&quot;</span><span class="fu">,</span></span>
<span id="cb95-5"><a href="#cb95-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;@Core.Description&quot;</span><span class="fu">:</span> <span class="st">&quot;Annotation on record&quot;</span><span class="fu">,</span></span>
<span id="cb95-6"><a href="#cb95-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;GivenName&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-7"><a href="#cb95-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;FirstName&quot;</span></span>
<span id="cb95-8"><a href="#cb95-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb95-9"><a href="#cb95-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;[email protected]&quot;</span><span class="fu">:</span> <span class="st">&quot;Annotation on record member&quot;</span><span class="fu">,</span></span>
<span id="cb95-10"><a href="#cb95-10" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Surname&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-11"><a href="#cb95-11" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;LastName&quot;</span></span>
<span id="cb95-12"><a href="#cb95-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb95-13"><a href="#cb95-13" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;DirectSupervisor&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-14"><a href="#cb95-14" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;Manager&quot;</span></span>
<span id="cb95-15"><a href="#cb95-15" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb95-16"><a href="#cb95-16" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;CostCenter&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-17"><a href="#cb95-17" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$UrlRef&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-18"><a href="#cb95-18" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Apply&quot;</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb95-19"><a href="#cb95-19" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;http://host/anotherservice/CostCenters(&#39;{ccid}&#39;)&quot;</span><span class="ot">,</span></span>
<span id="cb95-20"><a href="#cb95-20" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span></span>
<span id="cb95-21"><a href="#cb95-21" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$LabeledElement&quot;</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb95-22"><a href="#cb95-22" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Path&quot;</span><span class="fu">:</span> <span class="st">&quot;CostCenterID&quot;</span></span>
<span id="cb95-23"><a href="#cb95-23" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb95-24"><a href="#cb95-24" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Name&quot;</span><span class="fu">:</span> <span class="st">&quot;ccid&quot;</span></span>
<span id="cb95-25"><a href="#cb95-25" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb95-26"><a href="#cb95-26" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span><span class="fu">,</span></span>
<span id="cb95-27"><a href="#cb95-27" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;$Function&quot;</span><span class="fu">:</span> <span class="st">&quot;odata.fillUriTemplate&quot;</span></span>
<span id="cb95-28"><a href="#cb95-28" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb95-29"><a href="#cb95-29" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb95-30"><a href="#cb95-30" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb95-31"><a href="#cb95-31" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb95-32"><a href="#cb95-32" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
</div>
<h3 id="14413-url-reference"><a name="URLReference" href="#URLReference">14.4.13 URL Reference</a></h3>
<p>The URL reference expression enables a value to be obtained by sending a <code>GET</code> request.</p>
Expand Down
52 changes: 28 additions & 24 deletions docs/odata-csdl-json/odata-csdl-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -5383,31 +5383,35 @@ a structured type with two structural properties `GivenName` and
annotated entity type, the fourth adds a calculated navigation property
that is pointing to a different service
```json
"@person.Employee": {
"@type": "https://example.org/vocabs/person#org.example.person.Manager",
"@Core.Description": "Annotation on record",
"GivenName": {
"$Path": "FirstName"
},
"[email protected]": "Annotation on record member",
"Surname": {
"$Path": "LastName"
},
"DirectSupervisor": {
"$Path": "Manager"
},
"CostCenter": {
"$UrlRef": {
"$Apply": [
"http://host/anotherservice/CostCenters('{ccid}')",
{
"$LabeledElement": {
"$Path": "CostCenterID"
},
"$Name": "ccid"
"$Annotations": {
"org.example.Person": {
"@org.example.hcm.Employee": {
"@type": "https://example.org/vocabs/person#org.example.person.Manager",
"@Core.Description": "Annotation on record",
"GivenName": {
"$Path": "FirstName"
},
"[email protected]": "Annotation on record member",
"Surname": {
"$Path": "LastName"
},
"DirectSupervisor": {
"$Path": "Manager"
},
"CostCenter": {
"$UrlRef": {
"$Apply": [
"http://host/anotherservice/CostCenters('{ccid}')",
{
"$LabeledElement": {
"$Path": "CostCenterID"
},
"$Name": "ccid"
}
],
"$Function": "odata.fillUriTemplate"
}
],
"$Function": "odata.fillUriTemplate"
}
}
}
}
Expand Down
Loading