-
Notifications
You must be signed in to change notification settings - Fork 43
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
Any examples for Flask-RestPlus Resource constructors ? #40
Comments
There's an example piece of code in the test suite, I hope this helps. |
Actually this example is ver simplified, and I'm trying the same but for some reason, it's failing, here's a question I posted on Stackoverflow if you can have a look at: |
Strange thing, when the resource's constructor is written like this: What's the reason that I have to add |
This is the signature of Flask-RESTPlus's def __init__(self, api=None, *args, **kwargs):
# ... (source) The If you want you can simplify your constructor to def __init__(self, some_input: type_of_input, api):
super().__init__(api)
# ... But that's as far as the simplifications will go right now. |
dependency_injector needs that constructor for calling itself, I've been diving into the documentation and no one mentions that this is a thing to consider, maybe should be included. |
Hi, I'm completely new to python world so excuse my lack of knowledge.
I read in the documentation that this also supports Flask-RestPlus Resource constructors, even though I could find neither here or on the internet any decent example that uses Flask-RestPlus with this library.
I tried my self and what I reached is that I need to consider the API resource like any other class and configure it with the binder, is this the correct way to do it?, because in the examples (while using with bare Flask) there was no need to configure the routes, as they are already a function, not a class, I don't know if this is the reason.
The text was updated successfully, but these errors were encountered: