-
Notifications
You must be signed in to change notification settings - Fork 52
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
Non-POST statics #100
Comments
Sorry for the delay. No, I don't think we currently have something for this, and it seems like we probably should. We have Regarding the implementation, it would probably be more symmetrical to implement it in the same way as Here I'm reusing the action identifier, but I now doubt that will work: it means each identifier needs both an action and a select associated with it, where generally you have only one: |
Can this be solved by using a singleton resource instead? If so we could perhaps even remove the If we add a new type variable for GET, will we later need to add even more for DELETE and others? Seems like this would get nasty quickly... |
You mean making I can't see a need for |
Oh, right... Would it be possible to hide these details under a statics field in the resource instead of specifying it for the resource itself? |
What do you mean exactly? |
+1, I would also like to see |
@fnoble Could you describe your use case? |
The same as @abbradar, I have some endpoints that are outside of just CRUD on a single resource. Basically it takes some parameters and returns something computed from the resources. |
statics
are supposed to be POST-only according to the tutorial, so there is no way for a resource to specify, e.g.,GET /count
(returns total number of items). Of course I can just usePOST
but this seems unRESTful to me. An improvement might be to specify method in the schema, like this:This looks better since statics are supposed to be CRUD-unrelated and can be closer to any method depending on what they actually do. I don't know the difficulty of improvement like this, though, maybe with current architecture this is hard.
Anyway, maybe I've just missed some easy method to accomplish this?
The text was updated successfully, but these errors were encountered: