HTTP-APIs / hydrus

REST server - Flask Hydra-powered for Semantic Web
https://pypi.org/project/hydrus/
MIT License
195 stars 130 forks source link

Change GET PUT POST DELETE requests format for collections #587

Closed Mec-iS closed 3 years ago

Mec-iS commented 3 years ago

I'm submitting a

[x] bug report.

Current Behaviour:

As discussed in the confcall, the current API semantics for operations on collections is far from being conventional:

/serverapi/MovieCollection/4f61070a-f647-4a65-9b0a-cbab4bcf0510/delete/3e1462f8-93ad-4a52-a371-a6fd5724c904, 1f6f1df8-788d-430a-8398-2e3302407fc0

Two major points:

Expected Behaviour:

The correct semantics should be

DELETE /serverapi/MovieCollection/4f61070a-f647-4a65-9b0a-cbab4bcf0510/?instances=3e1462f8-93ad-4a52-a371-a6fd5724c904,1f6f1df8-788d-430a-8398-2e3302407fc0

The operation method should be only defined in the request method and the list of ids to delete should be defined in a proper instances parameter. Every HTTP method can accept URL parameters (including PUT and DELETE).

chrizandr commented 3 years ago

Just a quick note, I would suggest we use members as the parameter instead of instances. Members is the name given to items in the collection, so that seems more appropriate.