Address review feedback:
- Gate the APPLICATION_ROOT-aware Swagger/OpenAPI registration on
FAB_API_SWAGGER_UI so the global Swagger disable still takes precedence.
- Suppress FAB's default OpenAPI/Swagger views (FAB_ADD_OPENAPI_VIEWS) when
the prefix-aware variant is active, so the two don't register duplicate URL
rules for /api/<version>/_openapi and /swagger/<version>.
- Normalize APPLICATION_ROOT (treat '/' as empty, strip trailing slash) so the
Swagger UI spec URL is not built as a protocol-relative '//api/...' URL.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adopts #34407 by @rsbhatti. Serves the OpenAPI spec and an APPLICATION_ROOT-aware
Swagger UI for Superset deployments behind a URL prefix (reverse proxy), gated by
a new FAB_API_SWAGGER_UI_SUPERSET_APP_ROOT flag (default False).
Adoption cleanups over the original:
- keep the existing FAB_API_SWAGGER_UI flag (the original removed it)
- drop an unrelated AUTH_ROLE_PUBLIC change that the original accidentally included
- add ASF license headers and type hints to the new openapi module
- fix the SupsersetSwaggerView -> SupersetSwaggerView class-name typo
- add a unit test for the schema-name resolver
Closes#34407Fixes#33304
Co-authored-by: rsbhatti <rajvindrasinghbhatti12@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>