Repository navigation
[RESTEASY-3807] CDI and Jakarta REST 5.0.0-M1 Integration - #5099
Merged
Merged
Conversation
jamezp
force-pushed
the
RESTEASY-3807-cdi-integration
branch
from
October 25, 2026 19:09
1db236f to
4ec2c82
Compare
Jakarta REST 5.0 requires CDI. Resources, providers and Application subclasses are now CDI beans, and CDI injects the Jakarta REST context types. `@Context` is implemented as a CDI qualifier, as proposed for the specification. - Make `@Path`, `@Provider` and `@ApplicationPath` bean defining annotations. Resources default to `@RequestScoped`, and providers and Application subclasses to `@ApplicationScoped`. Unproxyable or generic classes fall back to `@Dependent` or `@Singleton` with a warning. - Register `@Default` and `@Context` synthetic beans for the Jakarta REST context types, replacing ContextProducers. Per-request types resolve the current request on each call, so they work after asynchronous resumption. Fail deployment if the application defines such a bean. - Register `@Context` beans for the Servlet types and the Application, with `@Default` beans only if no other bean provides the type. - Inject resource method parameters of the context types, e.g. AsyncResponse and SseEventSink, without an annotation. - Support `@Inject` constructors for resources and providers, including through ResourceContext.getResource(). - Invoke ResourceFactory.requestFinished() and destroy `@Dependent` resources when the request completes, including asynchronous requests. Add the RequestListener SPI. - Create normal scoped resource instances after the request filters and before parameter injection (InjectorFactory.unwrapProxy). Add InjectorFactory.resolveType for container proxy classes. - Validate resources created by CDI as before. resteasy-validator-provider no longer depends on resteasy-cdi. - Remove dev.resteasy.cdi.enhanced.enabled, CdiOptions and ContextProducers. Deprecate resteasy.proxy.implement.all.interfaces. - Enable implicit bean archive scanning in the Undertow CDI embedded server. - Document the changes in the RESTEasy 8 migration guide. https://redhat.atlassian.net/browse/RESTEASY-3807 Signed-off-by: James R. Perkins <[email protected]>
…ed the required dependencies to resteasy-validator-provider. Signed-off-by: James R. Perkins <[email protected]>
jamezp
force-pushed
the
RESTEASY-3807-cdi-integration
branch
from
October 25, 2026 22:18
4ec2c82 to
2fadd3a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://redhat.atlassian.net/browse/RESTEASY-3807
Jakarta REST 5.0 requires CDI. Resources, providers and Application
subclasses are now CDI beans, and CDI injects the Jakarta REST context
types.
@Contextis implemented as a CDI qualifier, as proposed forthe specification.
@Path,@Providerand@ApplicationPathbean definingannotations. Resources default to
@RequestScoped, and providers andApplication subclasses to
@ApplicationScoped. Unproxyable or genericclasses fall back to
@Dependentor@Singletonwith a warning.@Defaultand@Contextsynthetic beans for the JakartaREST context types, replacing ContextProducers. Per-request types
resolve the current request on each call, so they work after
asynchronous resumption. Fail deployment if the application defines
such a bean.
@Contextbeans for the Servlet types and the Application,with
@Defaultbeans only if no other bean provides the type.AsyncResponse and SseEventSink, without an annotation.
@Injectconstructors for resources and providers, includingthrough ResourceContext.getResource().
@Dependentresources when the request completes, including asynchronous requests.
Add the RequestListener SPI.
and before parameter injection (InjectorFactory.unwrapProxy). Add
InjectorFactory.resolveType for container proxy classes.
no longer depends on resteasy-cdi.
ContextProducers. Deprecate resteasy.proxy.implement.all.interfaces.
server.