Skip to content

fixing issue where FastAPI would not allow new paths to be added#3668

Open
BSd3v wants to merge 1 commit intoplotly:v4.1from
BSd3v:v4.1-fix-FastAPI-paths
Open

fixing issue where FastAPI would not allow new paths to be added#3668
BSd3v wants to merge 1 commit intoplotly:v4.1from
BSd3v:v4.1-fix-FastAPI-paths

Conversation

@BSd3v
Copy link
Contributor

@BSd3v BSd3v commented Mar 17, 2026

fixes #3667

This uses the lifespan to load the catchall when the server starts, allowing all other urls to be added properly.

Comment on lines +191 to +192
print("Error during catch-all setup:")
print(traceback.format_exc())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

traceback.print_exc() should be enough.


def _setup_catchall(self):
try:
print("Setting up catch-all route for unmatched paths")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove print or replace with a logger.debug call.

methods: list[str] | None = None,
include_in_schema: bool = False,
):
print(f"Adding URL rule: {rule} -> {view_func} (endpoint: {endpoint}, methods: {methods})")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants