[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: How do you handle a combined primary unique index with a single endpoint REST URI?

Status
Not open for further replies.
P

Peter Judge

Guest
OData uses one of 2 approaches - the one @hutct lays out (path segment) and one with a parenthesis-wrapping approach. See OData Version 4.01. Part 2: URL Conventions host/.../OrderItems(OrderID=1,ItemNo=2) host/.../2 The parens style would seem to me to be the better ("more correct") approach in the sense that path segments tend to be interpreted as parent-child although there's nothing in the spec that would indicate that they should be so . FWIW in PASOE webhandlers you _can_ define tokens to deal with the former (both actually) as below. handler5=Example.API.OrderHandler: /OrderItems(OrderId={order-id},ItemNum={item-id}) handler6=Example.API.OrderHandler: /OrderItems/{order-id}/{item-id} In your handler, you'd extract those values using the request define variable orderId as integer no-undo. define variable itemId as integer no-undo. orderId = integer(poRequest:GetPathParameter('order-id')). itemId = integer(poRequest:GetPathParameter('item-id')). I think I agree with the comments that an opaque id (like a ROWID or GUID or similar) isn't great , although that does veer into religious warfare so I'd just suggest not using a ROWID value as a ROWID.

Continue reading...
 
Status
Not open for further replies.
Top