Closed ianbuss closed 3 months ago
Thanks for reporting this! I am not sure how to solve this yet but I'll take a close look today.
Thanks for reporting this! I am not sure how to solve this yet but I'll take a close look today.
Thanks @zmievsa! I'll look into the code as well just for my understanding of how Cadwyn is doing things here.
@ianbuss Please, check whether your problem was fixed in 3.15.6. I added a test case specifically with svcs.
Looks like a strange pydantic bug to me but sadly I have no time to fix it in its entirety right now. I'll try to come up with some approach that makes such errors impossible. However, the part that affected svcs is gone.
Thanks @zmievsa ! Will try it out and let you know.
Hi! I found a way to fix the core of this bug, not just the "Request" part of it. Now it's fully gone and I am fairly certain that it will not come back in any other way, shape or form.
Fix in 3.15.7
Upgraded and it's working fine, thanks for the fix(es) @zmievsa !
Thank you for reporting this bug!
Describe the bug There is a Pydantic issue when using a svcs dependency in a router function signature. For example, this kind of function:
produces the following error in a Cadwyn app:
This seems to be something to do with the dependency function being defined in an external package I think, as if I copy the underlying function (https://github.com/hynek/svcs/blob/9cca7dde04a318c9f876dd12226b9b488d9721bc/src/svcs/fastapi.py#L78) into my code, it works fine.
To Reproduce
services: svcs.fastapi.DepContainer
dependency to a router funtionExpected behavior Cadwyn should be able to treat the svcs dependency as a standard FastAPI
Depends
.