apache/superset

Unable to access swagger API after enabling prefix routing

已关闭

#33,304 创建于 2025年4月30日

 (5 条评论) (0 个反应) (0 位负责人)TypeScript (17,291 个派生)batch import
apigood first issue

仓库指标

星标
 (72,837 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Bug description

I'm having an issue with accessing the /api/v1/_openapi endpoint. It looks like it redirects to /api/v1/_openapi but it should be going to /prefix/api/v1/_openapi it would be nice to expose the swagger config so we can do something like this.

OPENAPI_SWAGGER_UI_CONFIG = {
    "url": "/prefix/api/v1/_openapi"
} 

Not sure if anyone else has seen this issue or is able to replicate it.

To replicate the issue just set

SUPERSET_APP_ROOT = "/prefix"

then attempt to go to /prefix/swagger/v1

Screenshots/recordings

Image

Superset version

master / latest-dev

Python version

3.10

Node version

I don't know

Browser

Chrome

Additional context

This was done via docker image

FROM apache/superset:GHA-dev-14737083364

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

贡献者指南