NatLibFi / voyager-http-api

RESTful HTTP API for Voyager ILS
Apache License 2.0
0 stars 0 forks source link

PUT /bib/<id> is not idempotic #5

Closed natlibfi-arlehiko closed 6 years ago

natlibfi-arlehiko commented 7 years ago

Calling PUT /bib/\<id> fails if called with the same data multiple times. Voyager requires MARC data to contain the latest timestamp. For this reason updating resources in Voyager cannot be done idempotically.

Suggested implementation

Ditch PUT on /bib/\<id> in favor of POST. POSTing on the resource should respond with status code 200 (On success) and return the updated data in the body.

petuomin commented 7 years ago

I would like to keep the PUT since it's very common to map PUT to update. Maybe the best solution is to keep it as is. Often the only interesting part is that the update has been applied successfully. In case the newly updated record is needed, the client is expected to fetch it and update the record in user's view.

natlibfi-arlehiko commented 6 years ago

The method will be kept as PUT