Closed rhyek closed 3 years ago
Actually I was expecting some sort of error thrown which I think should be the correct behaviour.
I understand now that resolve
here is similar to inversify's resolve
, but there is no get
in tsyringe that provides a sort of "strict" alternative.
Yeah, this is the by-design behavior - given a constructor
, TSyringe will attempt to resolve it when requested, even if it's not registered. This is behavior brought over from the old C# Unity container.
This is really dangerous for our use case. As described in #245, we use child containers for properly configured instances of OpenAPI-generated classes. If we accidentally resolve such a class from the root container, we will get an unwanted default instance which calls the base URL that the OpenAPI generator copied from the YAML spec into the code.
Guess I'll have to keep the GitHub workflow check that all servers in the YAMLs must be ….example.org. That check was meant to be removed once we have our DI / configuration set up.
Describe the bug Providers are being resolved when not registered through any mechanism.
To Reproduce
Expected behavior should output:
actual output:
Version:
4.5.0