Open Macktireh opened 8 months ago
I don't think this is currently possible. If you have a look at the code for the flask-restx resource class, it matches method names against the incoming HTTP request.method
.
You could probably write your own custom Resource to structure the code in this way, but it's unlikely flask-restx
will make this possible going forwards.
Ask a question
Hello,
I've tested the example of the Todo API that you provided. It's structured using classes to define the API resources. However, I'm wondering if it's possible to write the code in a different way by grouping all CRUD operations into a single controller class called TodoController.
Here's the initial example I retrieved from Flask-RESTx documentation:
And here's the reorganized version with the TodoController class:
Is it possible to adopt this structure to manage CRUD operations in a more concise and organized manner? Additionally, will Flask-RESTx support this type of structure in the future?
Thank you.