Skip to content
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

Playground can't load assets when using APIRouter #233

Closed
anhi opened this issue Nov 16, 2023 · 3 comments
Closed

Playground can't load assets when using APIRouter #233

anhi opened this issue Nov 16, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@anhi
Copy link
Contributor

anhi commented Nov 16, 2023

Hi,

in a modularized application with APIRouter-instances that set their own prefix, loading the playground does not work, as the prefix path is not prepended for the assets.

This seems like a simple fix: replacing line 1032 of server.py with

f"{namespace}/playground" if isinstance(app, FastAPI) else f"{app.prefix}{namespace}/playground",

works for me. I've prepared a corresponding pull request.

@eyurtsev eyurtsev self-assigned this Nov 16, 2023
eyurtsev added a commit that referenced this issue Nov 16, 2023
#233 -- signed cla bot
@eyurtsev eyurtsev added the bug Something isn't working label Nov 16, 2023
@eyurtsev
Copy link
Collaborator

Thanks for the PR -- I'm taking a look -- will commandeer to add tests

@eyurtsev
Copy link
Collaborator

Had to open a new PR to push changes. Closing this PR in favor of: #236

@eyurtsev
Copy link
Collaborator

Fixed in #236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants