looking a possible way to use a factory declared in the containers in pydantic validation. #700
Unanswered
pelissarisergioo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone, I've been enjoying the usage of this library in my APIs, I'm doing an evaluation to get it in place together with Fastapi. I've been stuck in a scenario where I'd like to use a client defined in the containers inside my Pydantic model. Because as far as I can see we can only apply the wiring in the endpoints where the DI process happens.
Basically during the validation process I need to request another endpoint to include more data in the model...
So my question is, how I could or is it possible to use a resource declared in the containers inside the Pydantic model so I don't need to replace it in multiple places when the client is changed?
Any small example will be more than welcome as well.
Beta Was this translation helpful? Give feedback.
All reactions