Skip to content

[RESTEASY-3807] CDI and Jakarta REST 5.0.0-M1 Integration - #5099

Merged
jamezp merged 2 commits into
resteasy:mainfrom
jamezp:RESTEASY-3807-cdi-integration
Oct 26, 2026
Merged

jamezp merged 2 commits into
resteasy:mainfrom
jamezp:RESTEASY-3807-cdi-integration

Conversation

@jamezp

@jamezp jamezp commented Oct 22, 2026

Copy link
Copy Markdown
Member

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. @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.

@jamezp
jamezp requested a review from a team as a code owner October 22, 2026 16:00
@jamezp
jamezp force-pushed the RESTEASY-3807-cdi-integration branch from 1db236f to 4ec2c82 Compare October 25, 2026 19:09
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
jamezp force-pushed the RESTEASY-3807-cdi-integration branch from 4ec2c82 to 2fadd3a Compare October 25, 2026 22:18
@jamezp
jamezp merged commit b9f1114 into resteasy:main Oct 26, 2026
10 of 11 checks passed
@jamezp
jamezp deleted the RESTEASY-3807-cdi-integration branch October 26, 2026 12:59
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

Successfully merging this pull request may close these issues.

1 participant