-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
introduce plugins to load openapi specs #11497
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
Conversation
LocalStack Community integration with Pro 2 files ±0 2 suites ±0 1h 35m 51s ⏱️ -42s Results for commit 2bf9217. ± Comparison against base commit 68366d1. This pull request removes 1 and adds 6 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
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.
While the change itself isn't looking bad, if the whole purpose is the extensibility, I think we should try to define a cleaner way for the extension.
What's the plan for merging multiple specs in the future? We need a mechanism for handling multiple specs here in Community as well. Maybe it would make sense to have multiple providers (maybe implemented in plux) which can provide their specs?
- use fixed files in importlib_resources - add a utility function we can patch in ext
c8e8575
to
b63ad9c
Compare
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.
Nice to see that the OpenAPI validator gets pluggable! In general the code looks good, but I would like to discuss the runtime implications of the plugin mechanism, and had some other nitpicks :P Afterwards we're good to go!
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.
In my opinion, this handler and the plugin definition deserves quite a lot more documentation. It's a cool new feature where only a very small amount of our contributors know about. Please make sure that everyone can take a look at this file and knows what it does, and how one can interact with it (enable it, disable it, register OpenAPI Spec plugins,...). ;)
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.
i second alex' comment here and think it can do with even a bit more doc. specifically i think it needs a more concrete example on how to use it. where do i put the openapi.yml? how do i correctly instantiate a new plugin? For some inspiration, maybe the docs on the WebAppExtension can help.
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.
Nice! LGTM 👍 just a minor nit regarding documentation
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.
i second alex' comment here and think it can do with even a bit more doc. specifically i think it needs a more concrete example on how to use it. where do i put the openapi.yml? how do i correctly instantiate a new plugin? For some inspiration, maybe the docs on the WebAppExtension can help.
Forgot we don't have importlib_resources in the runtime dependencies and the standard library does not handle namespace packages installed in editable mode
Motivation
This PR is a small improvement over #11452.
Changes