-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_WD01
-
Fix Version/s: V4.0_WD01
-
Component/s: URL Conventions
-
Labels:None
-
Environment:
[Proposed]
-
Proposal:
-
Resolution:
OData allows inheritance for entity types and complex types, and since V3 allows restricting to derived types in URLs, e.g.
GET ~/Customers/Model.VipCustomer (restrict result to VipCustomer instances)
GET ~/Customers/Model.VipCustomer(1) (404 if customer 1 is no VipCustomer)
GET ~/Customers(1)/Model.VipCustomer (same as above)
GET ~/Customers(1)/Address/Model.AddressWithLotsOfDetails/SomeDetailNotInPlainAddress/$value (cast complex property to subtype, then follow path)
The current ABNF rules allow the above resource paths, plus "casting" to derived types in system query options (curiously enough only for entity types, but not for complex types):
GET ~/Customers?$filter=Model.VipCustomer/PercentageOfVipPromotionProductsOrdered gt 80 (false for all non-VipCustomers)