-
-
Notifications
You must be signed in to change notification settings - Fork 780
Add plugins support #728
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
Add plugins support #728
Conversation
9f1caf9 to
8426b06
Compare
| will be passed the framework's request context. | ||
| :type pass_context_arg_name: str | None | ||
| :param plugins: list of plugin classes | ||
| :type plugins: list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| :type plugins: list | |
| :type plugins: list | None |
| will be passed the framework's request context. | ||
| :type pass_context_arg_name: str | None | ||
| :param plugins: list of plugin classes | ||
| :type plugins: list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| :type plugins: list | |
| :type plugins: list | None |
| logger.debug('... Adding uri parsing decorator (%r)', uri_parsing_decorator) | ||
| function = uri_parsing_decorator(function) | ||
|
|
||
| for plugins_decorator in self.__plugins_decorator: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the for loop?
self.__plugins_decorator yields once.
|
I think this PR as-is is significantly less flexible than overriding I think the plugin concept is cool, but IMHO it should aim to basically replace the entire What do you think? Do you like the django-style approach? BTW thanks for making the PR, I think it is perfect for starting concrete discussion around a plugin architecture! |
|
Hey @dtkav Thanks for the review. I see your point about the lack of flexibility in the current PR. The Django middleware seems interesting, and a similar principle might apply here as well, Would you like me to have another go at it or would you rather wait for more input on this? |
|
I prefer the approach in #760 for making pluggable deserialization/validation. I think the same approach will extend well to serialization. What other kinds of plugins does this PR enable that content-type based plugins might not? |
|
Closing due to lack of contributor feedback. |
Fixes #719 .
This is an initial version to see if I'm on the right track,
I'll be happy to hear some feedback,
then I'll add the tests.
FYI @dtkav