ivoa-std / VOSpace

Virtual Observatory User Storage
Creative Commons Attribution Share Alike 4.0 International
3 stars 4 forks source link

Throw an Invalid Argument fault if the pagination uri is not a direct child #12

Open Zarquan opened 3 years ago

Zarquan commented 3 years ago

The current specification does not say what happens if the path of the uri parameter in a getNode request points to a node that is not a direct child of the target node.

GET /vospace/nodes/mydir?limit=2&uri=vos://example.com!vospace/other/file-003

In this example the path of the uri vospace/other/file-003 does not point to a direct child of the target node /vospace/nodes/mydir and so would match the criteria for throwing an exception.

This is different to the case where the path of the uri is within the scope of the target node, but points to a child that does not exist.

GET /vospace/nodes/mydir?limit=2&uri=vos://example.com!vospace/mydir/missing-file

In this example the path of the uri vospace/mydir/missing-file does point to a location within the target node /vospace/nodes/mydir. However the specific child it points to missing-file does not exist. This matches the case where missing-file was listed in a previous page of a paginated request for /vospace/nodes/mydir, but has been deleted before the client sent the request for the next page.

In this situation, should the server respond with:

  1. An empty response, because the page start no longer exists.
    • This is a misleading response, because there may be more children after the missing node
  2. Throw a NodeNotFound fault because the start child cannot be found
    • This is a misleading response, because this implies the parent container can't be found.
  3. Try to find the next available start location given the name of the missing node and the pagination order.
    • This is hard to do reliably in a consistent way across different implementations.