Add alias to annotation routes

closes #274 (closed)

To be more compliant with STAC, the collectionID (and sometimes the itemID) were needed in the API routes even if they were not really useful.

This MR adds aliases to some routes:

  • GET /api/collections/:collectionId/items/:itemId is equivalent to GET /api/pictures/:picId
  • GET /api/collections/:collectionId/items/:itemId/annotations is equivalent to GET /api/pictures/:itemId/annotations
  • POST /api/collections/:collectionId/items/:itemId/annotations is equivalent to POST /api/pictures/:itemId/annotations
  • GET /api/collections/:collectionId/items/:itemId/annotations/:annotationId is equivalent to GET /annotations/:annotationId
  • PATCH /api/collections/:collectionId/items/:itemId/annotations/:annotationId is equivalent to PATCH /annotations/:annotationId

Note that I did not use redirect as it won't work with post/patch, so I added real routes instead to be coherent

Edited by antoine-de

Merge request reports

Loading
Loading