-
Notifications
You must be signed in to change notification settings - Fork 820
docs: add minimal example for usage with inversify #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So I had to actually remove the use of the DI container all together it seems to have it working Before
I removed the ☝️ code and it works. Is that the correct approach? Cheers :) |
Without useContainer I think it doesn't solve dependencies and they are undefined, please check them in constructors of your validators. |
@satanTime I'm facing this problem too using class-validator with inversify. I do not have a |
Hi @harindaka, Is there a chance to create an example with min code to reproduce the issue? |
@satanTime ok after some googling, I found that it is necessary to use an adaptor for third party DI containers such as inversify to work. Obviously this must be the reason for me since I was not aware of that. It's not super obvious to someone who's only using class validator and not routing controllers. Maybe update the documentation for class-validator to link to that? |
@harindaka, yep, makes sense, might you create a PR? I think you know better how to describe it. |
Same issue. Any progress for supporting inversify? |
any official documentation piece for this? |
The following could be a solution!
|
@ttruongatl I tried your solution but now I get: I am using routing-controllers, inversify and class-validator.
|
Description
Hello everyone.
Using the last version 0.12.2 I receive
Just wondering If some more changes need to be done
https://github.com/typestack/class-validator/search?q=getFromContainer&unscoped_q=getFromContainer
Any ideas?
Thanks for all the hard work btw 👍
Environment
class-validator version:
0.12.2
The text was updated successfully, but these errors were encountered: