-
Notifications
You must be signed in to change notification settings - Fork 14k
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
chore: use new FAB functionality for component schemas update OAS #17967
Conversation
Codecov Report
@@ Coverage Diff @@
## master #17967 +/- ##
==========================================
- Coverage 67.10% 67.07% -0.04%
==========================================
Files 1612 1609 -3
Lines 64992 64892 -100
Branches 6871 6868 -3
==========================================
- Hits 43615 43524 -91
+ Misses 19510 19502 -8
+ Partials 1867 1866 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 much prefer this new UI! Also, great to see this logic being moved upstream! 🙂 LGTM
self.openapi_spec_component_schemas: Tuple[ | ||
Type[Schema], ... | ||
] = self.openapi_spec_component_schemas + ( |
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.
Do we really need this type declaration? Seems like this should be enough:
self.openapi_spec_component_schemas: Tuple[ | |
Type[Schema], ... | |
] = self.openapi_spec_component_schemas + ( | |
self.openapi_spec_component_schemas = self.openapi_spec_component_schemas + ( |
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.
it does, and it surprised me also, this is declared on FAB here: https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/api/__init__.py#L297
…ache#17967) * chore: use new FAB functionality for component schemas and update OpenAPI spec * remove unused import * fix spec and lint * EOF fix * update open api spec with latest master
…ache#17967) * chore: use new FAB functionality for component schemas and update OpenAPI spec * remove unused import * fix spec and lint * EOF fix * update open api spec with latest master
SUMMARY
FAB 3.4.3 now implements
openapi_spec_component_schemas
;) this PR removes that functionality from Superset.Also the new version properly uses OpenAPI spec servers with actual servers and we can now define a list of servers for docs, by default the included swagger UI will set the current request host URL.
Since the spec is not using a base path (
api/v1
) anymore and FAB is not relying on theresource_name
to infer the spec path but theroute_base
(this used to be a limitation). All endpoints are declared with their full relative path:This PR also fixes the OpenAPI spec auto generation for Superset docs, so that all the schema components are not declared with
MetaN
anymore.So these have are not duplicated anymore:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION