[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] (ODATA-1064) Add ability to annotate collections to return only count and NextLink
[ https://issues.oasis-open.org/browse/ODATA-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
George Ericson updated ODATA-1064:
----------------------------------
Proposal:
Add new IncludeMetadata term:
----------------
<Term Name="IncludeMetadata" AppliesTo="NavigationProperty EntitySet Singleton" Type="Core.MetadataKind">
<Annotation Term="Core.Description"
String="Defines metadata that should automatically be returned in a response when the reply is qualified with 'metadata=minimal'." />
</Term>
<EnumType Name="MetadataKind" IsFlags="true">
<Member Name="count" Value="1">
<Annotation Term="Core.Description"
String="Return count metadata, equivalent to $count." />
</Member>
<Member Name="navigationLink" Value="2">
<Annotation Term="Core.Description"
String="This URL can be used to retrieve an entity or collection of entities related to the current entity via a navigation property. Doing a GET on this link is equivalent to specifying $expand."/>
</Member>
<Member Name="associationLink" Value="4">
<Annotation Term="Core.Description"
String=" The value is a URL that can be used to retrieve a reference to an entity or a collection of references to entities related to the current entity via a navigation property. Doing a GET on this link is equivalent to specifying $ref." />
</Member>
</EnumType>
--------------------
Example:
Proposed schema
<EntityType Name="Top">
…
<NavigationProperty Name="Systems" Type="Collection(ComputerSystem)">
<Annotation Term="OData.IncludeMetadata"
EnumMember="Core.MetadataKind/count Core.MetadataKind/navigationLink" />
</NavigationProperty>
…
</EntityType>
<EntityType Name="ComputerSystem">
…
</EntityType>
----------
Example: GET
-----------
GET /redfish/v1/Top
Response
{
"@odata.context": "/redfish/v1/$metadata#Top",
"@odata.id": "/redfish/v1/Top",
"@odata.type": "#Top ",
"Name": "Top",
…
"Systems@odata.count": 15,
"Systems@odata.navigationlink": {"/redfish/v1/Systems"}
…
}
was:
Add new IncludeMetadata term:
----------------
<Term Name="IncludeMetadata" AppliesTo="NavigationProperty EntitySet Singleton" Type="Core.MetadataKind">
<Annotation Term="Core.Description"
String="Defines metadata that should automatically be returned in a response." />
</Term>
<EnumType Name="MetadataKind" IsFlags="true">
<Member Name="count" Value="1">
<Annotation Term="Core.Description"
String="Return count metadata, equivalent to $count." />
</Member>
<Member Name="navigationLink" Value="2">
<Annotation Term="Core.Description"
String="This URL can be used to retrieve an entity or collection of entities related to the current entity via a navigation property. Doing a GET on this link is equivalent to specifying $expand."/>
</Member>
<Member Name="associationLink" Value="4">
<Annotation Term="Core.Description"
String=" The value is a URL that can be used to retrieve a reference to an entity or a collection of references to entities related to the current entity via a navigation property. Doing a GET on this link is equivalent to specifying $ref." />
</Member>
<Member Name="none" Value="8">
<Annotation Term="Core.Description"
String="This enumeration specifies that the return value shall not include metadata." />
</Member>
</EnumType>
--------------------
Example:
Proposed schema
<EntityType Name="Top">
…
<NavigationProperty Name="Systems" Type="Collection(ComputerSystem)">
<Annotation Term="OData.IncludeMetadata"
EnumMember="Core.MetadataKind/count Core.MetadataKind/navigationLink" />
</NavigationProperty>
…
</EntityType>
<EntityType Name="ComputerSystem">
…
</EntityType>
----------
Example: GET
-----------
GET /redfish/v1/Top
Response
{
"@odata.context": "/redfish/v1/$metadata#Top",
"@odata.id": "/redfish/v1/Top",
"@odata.type": "#Top ",
"Name": "Top",
…
"Systems@odata.count": 15,
"Systems@odata.navigationlink": {"/redfish/v1/Systems"}
…
}
Since use case is unclear, updated proposal removes 'none' as an option for MetadataKind.
Update proposal to scope the affect to responses formatted with 'metadata=minimal'.
> Add ability to annotate collections to return only count and NextLink
> ---------------------------------------------------------------------
>
> Key: ODATA-1064
> URL: https://issues.oasis-open.org/browse/ODATA-1064
> Project: OASIS Open Data Protocol (OData) TC
> Issue Type: New Feature
> Components: Vocabularies
> Affects Versions: V4.0_CSD01
> Reporter: George Ericson
> Assignee: George Ericson
> Labels: Proposed, request_tc_discussion
> Fix For: V4.01_CS02, V4.0_ERRATA04
>
>
> Issues with NavigationProperty
> 1) If AutoExpand or AutoExpandReferences is not specified, then a GET without $expand or $ref query parameters will not return any representation of declared NavigationProperties.
> 2) If AutoExpand or AutoExpandReferences is specified, the concern is that the returned representation of the containing entity might be too large.
> 3) For an EntityType containing many NavigationProperties, it is difficult to specify the desired information using query parameters.
> The Redfish specification attempts to solve these issues by introducing an intermediate resource that contains the original collection as a Members collection. The intermediate resource is then referenced via a NavigationProperty with AutoExpandReferences. The new resource is required to return $count as a metadata property of the Members collection. The value is the size of the original collection.
> For the most part, this is successful, but the solution creates several new problems.
> 1) Redfish specifies that a POST to the intermediate resource is equivalent to doing a POST to the contained collection. This is not conformant.
> 2) Introduction of many intermediate resources makes the resulting model more complex.
--
This message was sent by Atlassian JIRA
(v6.2.2#6258)
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]