8000 Fix #85 issue by FAbrickA · Pull Request #366 · fastapiutils/fastapi-utils · GitHub
[go: up one dir, main page]

Skip to content

Fix #85 issue #366

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FAbrickA
Copy link

Issue: #85

If you leave empty path in route like that:

router = APIRouter(prefix="/api")

@cbv(router)
class CBV:
    @router.get("")
    def root(self) -> str:
        return "hello"

you will get error:

fastapi.exceptions.FastAPIError: Prefix and path cannot be both empty

Here I fix it.
I know that this solution may look like a crutch. However, after spending many hours I was unable to find a better solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0