Skip to content

Conversation

@jonatanklosko
Copy link
Contributor

🐈

else:
full_path = path_info

full_path = full_path.rstrip("/")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case of FastAPI the full path is /tidewave/ at this point.

# so that we check the attribute on the specific model,
# otherwise we may access the attribute inherited from
# parent.
if model.__dict__.get("__abstract__", False):
Copy link
Contributor Author

@jonatanklosko jonatanklosko Oct 22, 2025

Choose a reason for hiding this comment

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

FastAPI uses sqlmodel, which is built on top of sqlalchemy. Models inherit from SQLModel, for example Hero(SQLModel). SQLModel has __abstract__ = True, and accessing it on Hero also returns True, because it's inherited. Checking the dict works as expected (since it doesn't include inherited attributes).

@jonatanklosko jonatanklosko merged commit 3266554 into main Oct 22, 2025
5 checks passed
@jonatanklosko jonatanklosko deleted the jk-fastapi branch October 22, 2025 22:40
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.

3 participants