Skip to content
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

ContextResolver(s) post-@Context injection #1206

Open
jim-krueger opened this issue Jan 24, 2024 · 2 comments
Open

ContextResolver(s) post-@Context injection #1206

jim-krueger opened this issue Jan 24, 2024 · 2 comments

Comments

@jim-krueger
Copy link
Contributor

jim-krueger commented Jan 24, 2024

The purpose of this issue is to discuss and ultimately document how ContextResolvers will be handled in Jakarta Rest after @context injection is deprecated/removed. This topic has been discussed in the rest-dev mailing list and I will attempt to add at least the latest discussion here.

@jim-krueger
Copy link
Contributor Author

From James Perkins:

This is where I'm wondering if I'm missing something TBH. I looked at the TCK and through the RESTEasy tests as well as read over the 3.1 specification. I don't see where you can inject a type that a ContextResolver resolves with @context. All the examples I see inject the Providers and lookup the ContextResolver to resolve the context type. Am I missing something? I might very well be, which is why I'm asking :) FWIW I thought it would work too, but all my local testing shows the injected values to always be null.

From Santiago:

Right, I think you’re correct in your analysis, this is only done programmatically. So it boils down to having support to inject Providers. However, having a method called getContextResolver in Providers when @context is deprecated may be a bit odd —but again backward compatibility is imperative here.

@jamezp
Copy link
Contributor

jamezp commented Jan 24, 2024

Given a ContextResolver is not used to inject components, should we keep it and not deprecate it? While it is similar to a CDI producer, it's not exactly the same. You can actually filter reslovers based on a MedaType. It seems that might still be desirable and would not be possible with a CDI producer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants