Skip to content

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