Open kito99 opened 7 months ago
...
@spericas please take a look and let me know (a) if this sounds correct, and (b) if you or someone on the committer team would like to contribute. Thanks!
@kito99 You cannot use @Inject
as a replacement for @Context
in all cases. There may be some implementations that support this in some cases, but for example, @Context
can be used in parameter position.
Regarding contributions, perhaps you ask for help on the Jakarta REST list.
thanks, @spericas! With respect to @Context
, what is the CDI replacement in cases where @Inject
doesn't work?
I'll definitely contact the mailing list.
thanks, @spericas! With respect to
@Context
, what is the CDI replacement in cases where@Inject
doesn't work?I'll definitely contact the mailing list.
For 4.0, we expect to support parameter injection directly, without the use of any special annotation. For that purpose, we plan to introduce a new @Body
annotation to identify the request entity (currently identified by having no Jakarta REST annotations).
@spericas ok, so it sounds like perhaps adding a warning admonition now might cause more confusion than necessary and people should just continue to use @Context
for now?
I just completed creating a workshop on REST 3.1 for the Eclipse Foundation. Ivar gave the workshop for the first time at EclipseCon last month and he and I will be giving it at Devnexus this April. In the workshop we look at SeBootstrap so possibly I could contribute some info on this topic to the tutorial.
Hey Ken, that would be awesome. This ticket outlines what I had in mind (short intro and example) but we’re flexible: https://github.com/jakartaee/jakartaee-tutorial/issues/86.
I will review the ticket later today.
@omniprof have you had a chance to review yet?
Sorry about running later than expected. Looking at it now.
I just sent you, via Email, my tutorial on SeBootstrap. If this meets the needs of the Tutorial then I can move on and do the MultiPart tutorial.
Recommended approach:
src/main/antora/modules/websvcs/pages/jaxrs/jaxrs.adoc
). Use either the example in the article below or an example from here.https://github.com/eclipse-ee4j/jakartaee-examples/tree/main/focused/rest
) and use that instead (please submit a PR to that repo with the example). This repo that has specific, simple examples, and is where future tutorial examples will go. See https://jakarta.ee/learn/docs/jakartaee-tutorial/current/security/security.html for examples of this approach (all of these examples are new).@Context
has been deprecated and you can use CDI instead. I believe you can use@Inject
instead in all cases but I'd prefer that someone verify that before adding it to the text. See: https://jakarta.ee/specifications/restful-ws/3.1/jakarta-restful-ws-spec-3.1#context-injection.src/main/antora/modules/websvcs/pages/jaxrs/jaxrs003.adoc
)I'm not sure we need to say anything about multi-part requests, but if folks feel differently, we can add a new section for that with an example just like the Java SE example above.
References: