Open livni opened 10 years ago
usually you want to use two different mapping for this: (with two different methods)
/todo/<todo_id>
and
/todos
Even if you wanted to have the same URL e.g. /todo/id
and /todo
(which in English is a bit confusing but ok...) you would still want to bind them to different methods I believe, it makes the methods a little easier and code a little easier to read.
@rantav flask-restful-swagger binds the swagger docs of the HTTP methods supported by the resource. if we have two endpoints /todo/ and /todo/id, they will have to be get methods of two different resources (correct me if i am wrong). Having two difference resources adds of lot of unnecessary code.
It's useful to consolidate GET requests for single or multiple objects as follows:
If I understand correctly, flask-restful-swagger only recognizes the first url and ignores the second url option. Perhaps we could support multiple decorators, one per url?