[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] (ODATA-820) Allow indexing into collections
[ https://issues.oasis-open.org/browse/ODATA-820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Pizzo updated ODATA-820:
--------------------------------
Proposal:
1) Introduce array collections [ODATA-820]
a. Define new term, "Ordered", to advertise that a collection has a stable order. If it is a collection of primitive or complex types it can be indexed by ordinal:
< Term Name="Ordered" Type="Core.Tag" DefaultValue="true" AppliesTo="Property,NavigationProperty,EntitySet,ReturnType">
< Annotation Term="Core.Description" String="Collection has a stable order. Ordered collections of primitive or complex types can be indexed by ordinal."/>
< /Term>
b. GET/PUT/PATCH/DELETE to the /{index} of an ordered collection of primitive or complex types retrieves/replaces/modifies/deletes just that item
i. /index cannot be appended to collections of entities or non-ordered collections
ii. Index is zero-based ordinal and follows JSONPointer syntax: collection/index
c. Update section 7.1.5 of the CSDL spec to note that it is possible to have an ordered collection of complex types with navigation properties.
2) Define a new "PositionalInsert" term to advertise that a collection supports inserting at a given ordinal [ODATA-820]
<Term Name="PositionalInsert" Type="Core.Tag" Default="true" AppliesTo="Property, NavigationProperty, EntitySet">
<Annotation Term="Core.Description" String="Items can be inserted at a given ordinal index."/>
</Term>
b. For collections of entity, complex, or primitive types annotated with PositionalInsert, client may specify new ?$index= query parameter in POST request to collection to specify where the item is inserted [ODATA-820]
was:
!) Define new term, "Array", to advertise that a collection of primitive or complex types support indexing:
< Term Name="Array" Type="Core.Tag" DefaultValue="true" AppliesTo="Property,ReturnType">
< Annotation Term="Core.Description" String="Collection members can be referenced by use of a zero-based ordinal index"/>
< /Term>
* Term cannot be applied to collections of entities
* GET/PUT/PATCH/DELETE to the /{index} of an ordered collection of non-entities (Array) retrieves/replaces/modifies/deletes just that item
* /index cannot be appended to collections of entities or non-ordered collections
* Index is zero-based ordinal and follows JSONPointer syntax: collection/index
* Update section 7.1.5 of the CSDL spec to note that it is possible to have an ordered collection (array) of complex types with navigation properties.
2) Define a new "PositionalInsert" term to advertise that a collection supports inserting at a given ordinal
<Term Name="PositionalInsert" Type="Core.Tag" Default="true" AppliesTo="Property, NavigationProperty, EntitySet">
<Annotation Term="Core.Description" String="Items can be inserted at a given ordinal index."/>
</Term>
* For collections of entity, complex, or primitive types annotated with PositionalInsert, client may specify new ?$index= query parameter in POST request to collection to specify where the item is inserted
> Allow indexing into collections
> -------------------------------
>
> Key: ODATA-820
> URL: https://issues.oasis-open.org/browse/ODATA-820
> Project: OASIS Open Data Protocol (OData) TC
> Issue Type: New Feature
> Components: OData URL Conventions, Vocabularies
> Affects Versions: V4.0_ERRATA02
> Environment: Set Operations, New Query Capabilities
> Reporter: Ralf Handl
> Assignee: Ralf Handl
> Labels: Extension, request_tc_discussion
> Fix For: V4.01_WD01
>
>
> Allow indexing into collections.
> If servers can guarantee a stable order, they could advertise this via an annotation.
> This could be combined with ETags to identify the state the client is referring to.
> This might be combined with $orderby to let the client choose the order.
--
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]