Is it possible to specify specs on a resource that is not in the same module as the API?
Ask a question Is it possible to specify specs on a resource that is not in the same module as the API?
Additional context I have posted the question as well on StackOverflow, but it did not receive much attention: https://stackoverflow.com/questions/73253718/flask-restx-how-to-specify-swagger-request-body-expectation-if-resource-resides.
The idea is to pass the specs as on the Methods of the resource definition and that in the app definition file this resource can just be added. When doing the resource definition I will not be able to access the api.expect decorator. Is there a solution to this problem? Thanks!
Yes, you just need to use the flask application factory structure to create your API. There is a good example of how to do this with flask-restx here: https://github.com/a-luna/flask-api-tutorial