Implementation of new query param ?limit=N on walks (T2114)
- Group Reviewers
- Maniphest Tasks
- T2114: swh-graph API: add ?limit=N method variants to return first N results
It can if last is True. But there's still the open question of what to do with the /last endpoint as ?limit is supposed to be a generalization. So until then I don't know what this should be.
You keep saying/asking that, but the easy hack you're referring to already clarifies in its description that last is not a generalization of limit. I suggest you reread the task description.
I'm saying the contrary, that limit is a generalization of last, which is I think what is written in the task description. Does that mean a /last?limit=N returns the last N nodes ?
The task description specifies that ?limit is for the head, not the tail.
If you want to generalize that to the tail and replace /last, maybe you could use positive numbers for head limits and negative numbers for tail limits?
This is consistent with what Python uses for indexing negative numbers, but I don't know if it's a good API.
I had the same idea and it's true that it seems weird for an API but why not.
Tell me what way you'd prefer.