Skip to content

Commit

Permalink
Merge pull request #45297 from gsmet/add-warning-context-injection-re…
Browse files Browse the repository at this point in the history
…steasy

RESTEasy - Mention you cannot inject @context elements in constructors
  • Loading branch information
geoand authored Dec 30, 2024
2 parents c1dda6a + 9125034 commit 049b246
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/main/asciidoc/resteasy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,12 @@ If set to `false`, then a *new instance* of the resource class is created per ea

An explicit CDI scope annotation (`@RequestScoped`, `@ApplicationScoped`, etc.) always overrides the default behavior and specifies the lifecycle of resource instances.

[WARNING]
====
`@Context` elements are not injected via CDI and, as such, may not be injected via constructor injection.
Inject `@Context` elements in fields of your resources instead.
====

== Include/Exclude Jakarta REST classes with build time conditions

Quarkus enables the inclusion or exclusion of Jakarta REST Resources, Providers and Features directly thanks to build time conditions in the same that it does for CDI beans.
Expand Down

0 comments on commit 049b246

Please sign in to comment.