rest icon indicating copy to clipboard operation
rest copied to clipboard

Define CDI scopes for all Jakarta REST types

Open spericas opened this issue 4 years ago • 4 comments

Most of these definitions are straightforward, but still need to be clearly stated in the spec. For next major release.

spericas avatar Apr 12 '21 17:04 spericas

Does this include adding @Stereotype to the annotations like @Path and @Provider?

jamezp avatar Nov 18 '22 16:11 jamezp

I want to point out the corner case, that it is possible to have multiple Rest Applications in single deployment unit. So things that are global to rest application, such as providers would not have a standard CDI scope, but would require custom scope instead.

pdudits avatar Aug 09 '23 14:08 pdudits

That is a good point. In #1158 there is a point in the API with the question:

Review support for Application subclasses: zero or more? zero or one?

The answer to that will have impact on this.

That said there are likely ways around it in the implementation. If more than one Application is defined, you wouldn't be able to just inject with a generic @Inject Application application;, but you could specific the specific application. Assuming the implementation supports that.

jamezp avatar Aug 09 '23 15:08 jamezp

Having more Application supported has additional impacts. Right now, the providers registered to the Application are only available by that application. But if more Applications take place, the providers could be visible by both Applications, especially when the providers are CDI beans, as the CDI environment is shared.

jansupol avatar Jan 16 '24 17:01 jansupol