-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
App - Router Magic [BUG] #1948
Comments
To resolve this, we would need the router to be container aware. The easiest way to do that is:
|
Can we identify what the exact bug is here? Is it that the router/route can't resolve the callable/invokable string without the container? |
The problem is that @geggleto is using the Router's map rather than the App's one. The App's one sets the Container instance onto the route object so that the callable resolver works. The proposed solution is to move the setting of the container to the route into the Router object rather than the App object. |
Thanks, I understand now. This takes me back to something I brought up a while back: we pass the container around too much. I would be in favour of composing the router to include the resolver, but IMO, passing the container to it is not a good idea. In the example provided, the code only requires that the invokable string is resolved, not the requirement for a container. What are your thoughts? |
That would probably work. Want to work up a PR? |
Ooof, I can try to find time. I know how crap that sounds. |
I was going about creating a Provider Object to manage dependencies of certain "modules"/"endpoints" in a project and I came across a bit of an annoyance.
Not really paying attention I simply tried the following:
Which I had assumed would be fine... but if you do this; you end up with an error...
The following is a fix:
Which leaves me wondering with some questions
I believe it is to grab the instance of CallableResolver, as it might not be used on EVERY request.
The text was updated successfully, but these errors were encountered: