-
-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
Just stumbled upon this (and admit I haven't actually tested it yet, apologies for that) but it looks like CRUDGenerator.get would not properly remove its existing GET route when overriding it:
| self.remove_api_route(path, ["Get"]) |
Looks like a typo to me - shouldn't it rather be "GET" instead of "Get" here?
The corresponding removal code compares to route.methods and IIRC FastAPI does uppercase all the methods:
fastapi-crudrouter/fastapi_crudrouter/core/_base.py
Lines 170 to 178 in 2670202
| def remove_api_route(self, path: str, methods: List[str]) -> None: | |
| methods_ = set(methods) | |
| for route in self.routes: | |
| if ( | |
| route.path == f"{self.prefix}{path}" # type: ignore | |
| and route.methods == methods_ # type: ignore | |
| ): | |
| self.routes.remove(route) |
Best regards,
Holger
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels