Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindOne endpoint #72

Closed
theofidry opened this issue May 21, 2015 · 5 comments
Closed

FindOne endpoint #72

theofidry opened this issue May 21, 2015 · 5 comments

Comments

@theofidry
Copy link
Contributor

The current filters on collections allow to search for entities matching a given criteria. But sometimes we don't want to find entities, but the first entity matching a criteria. The easiest way to achieve that would be to add an endpoint /offers/findOne?criteria. So basically an endpoint on which the filters enabled for the collection are enabled too, but which returns the first entity found, pretty much like we did /offers?criteria and then retrieved hydra:member[0].

Do you think this could be added or do you deem it too specific?

@dunglas
Copy link
Member

dunglas commented May 22, 2015

What about a search with items by pages set to one? Supporting something like a findOne entry point looks over complicated and is against REST principles.

@theofidry
Copy link
Contributor Author

Yeah but the items by page may be disabled right? Or we can consider that for this case the developer must enabled custom pagination and specify the value but it does not feel right. Since there is no doc for the custom pagination right now I can't check right away.

Supporting something like a findOne entry point looks over complicated and is against REST principles.

For that point you know a deal more than me^^ Whatever the solution should be it would be great to have it in the doc too.

@dunglas
Copy link
Member

dunglas commented May 22, 2015

In REST, there is only resources and collection of resources (lists). It doesn't hurt me if a collection contain only one element.

@theofidry
Copy link
Contributor Author

No I didn't mean the structure of the response, a collection with one item is perfectly fine by me. But the configuration seems a bit more annoying.

@theofidry
Copy link
Contributor Author

I close it for the moment I'll repopen it depending of the configuration required if it's really too much for such simple use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants