greptilian logo

IRC log for #rest, 2015-05-05

https://trygvis.io/rest-wiki/

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:08 shrink0r_ joined #rest
00:14 fumanchu joined #rest
01:07 _ollie joined #rest
01:33 marcules joined #rest
01:33 marcules joined #rest
03:10 _ollie joined #rest
03:54 baweaver joined #rest
05:13 _ollie joined #rest
06:10 akurilin joined #rest
06:15 _ollie joined #rest
06:27 _ollie joined #rest
06:33 akurilin joined #rest
06:45 vanHoesel joined #rest
07:22 interop_madness joined #rest
07:54 quimrstorres joined #rest
08:01 graste joined #rest
08:33 shrink0r joined #rest
09:19 mezod joined #rest
09:35 quimrstorres joined #rest
10:21 Left_Turn joined #rest
11:19 quimrstorres joined #rest
11:26 quimrstorres joined #rest
11:56 quimrstorres joined #rest
12:04 Wildblue` joined #rest
12:26 eschmidbauer joined #rest
12:40 _ollie joined #rest
12:48 vanHoesel joined #rest
12:49 quimrstorres joined #rest
13:15 quimrstorres joined #rest
13:49 nkoza joined #rest
13:59 mezod joined #rest
14:31 vanHoesel joined #rest
15:03 pindonga hi, a question about desiging a specific endpoint.. I have some items for a shopping cart... those items have an id (primary identifier at db level) and a sku (user friendly identifier)
15:04 pindonga the id will never change for an item, but the sku might change
15:04 pindonga I need to support both retrieve and update operations on the items
15:05 pindonga and I'd like to support retrieving an item by either id or sku (like GET /items/{id} or GET /items/{sku}), but when updating an item I need to specify the path by id (POST /items/{id})
15:06 pindonga the problem is how to specify which field I'm using to look up the item by, in a way that leaves the api simple for the user
15:06 pindonga I tried using GET /items/foo?lookup_key=sku but that's not as simple as just /items/foo
15:06 pindonga any suggestions?
15:08 pindonga I also tried looking up by id first then by sku server side and returning the first match, but that also has a problem: if the user sees a link for an item with sku '2' (thus the url is /items/2) and some time before the user requests that item a new item is added with id 2 (thus /items/2) the user will get the wrong item
15:13 pdurbin pindonga: here we support lookup by id number (long) or alias (String) ... in the findDataverse method: https://github.com/IQSS/dataverse/blob/master/src/main/java/edu/harvard/iq/dataverse/api/AbstractApiBean.java#L160
15:14 pindonga pdurbin, but then you have the constraint that alias cannot be numeric, correct?
15:14 pindonga ie, you're restricting the possible values for alias
15:14 pindonga based on an implementation detail (which is what I was trying to avoid)
15:15 pdurbin pindonga: yes, exactly: https://github.com/IQSS/dataverse/issues/1461
15:16 pindonga thx
15:24 vanHoesel joined #rest
15:34 fumanchu pindonga: I would have items/bysku/{sku} redirect to items/{id}
15:35 fumanchu or even skus/{sku} redirect to items/{id}
15:35 pindonga fumanchu, ack, thx for the idea
15:35 pindonga I was also considering using filtering for sku access, like /items?sku=sku
15:35 pindonga and have specific item be accessible only via id
15:36 fumanchu can a sku map to more than one id?
15:41 pindonga it shouldn't
15:42 pindonga at any given time, but it could change to which id it maps to
15:42 pindonga ie, item 1 has sku foo1, then it gets renamed to foo2, then item 2 is added with sku foo1
15:42 pindonga this is valid
15:42 fumanchu sounds like the reason HTTP redirects were created ;)
15:42 pindonga but you cannot have item1 and item2 have sku foo1 at the same time
15:54 trygvis pindonga: I would let the resource include a link with rel=self which should be used to update the resource
16:19 saml joined #rest
16:38 vanHoesel joined #rest
16:50 quimrstorres joined #rest
17:50 shrink0r joined #rest
17:52 angular_mike joined #rest
18:27 quimrstorres joined #rest
18:37 Wildblue joined #rest
18:37 Wildblue joined #rest
18:38 Wildblue joined #rest
18:38 Wildblue joined #rest
18:38 Wildblue joined #rest
18:39 Wildblue joined #rest
18:39 Wildblue joined #rest
18:39 Wildblue joined #rest
18:40 Wildblue joined #rest
18:40 Wildblue joined #rest
18:41 Wildblue joined #rest
18:41 Wildblue joined #rest
18:41 Wildblue joined #rest
18:42 Wildblue joined #rest
18:42 Wildblue joined #rest
18:48 fumanchu joined #rest
18:53 eschmidbauer left #rest
18:53 shrink0r joined #rest
19:15 quimrstorres joined #rest
19:52 fumanchu_ joined #rest
20:55 quimrstorres joined #rest
21:40 BP-Max joined #rest
21:41 BP-Max left #rest
21:56 quimrstorres joined #rest
22:27 pdurbin1 joined #rest
22:29 alxbl_ joined #rest
22:29 benaiah` joined #rest
22:29 ramsey_ joined #rest
22:29 angular_mike_ joined #rest
22:30 SupaHam joined #rest
22:33 ChrisAnn joined #rest
22:46 mezod joined #rest
22:55 vanHoesel joined #rest
23:43 quimrstorres joined #rest

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

https://trygvis.io/rest-wiki/