Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-16545

Assign Jakarta REST annotations to be bean defining annotations

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • CDI / Weld, REST
    • None

      Section 11.2.3 of the Jakarta REST Spec requires that applications, providers and resources should have a default CDI scope.

      In a product that supports CDI, implementations MUST support the use of CDI-style Beans as root resource classes, providers and Application subclasses. Providers and Application subclasses MUST be singletons or use application scope.

      For example, assuming CDI is enabled via the inclusion of a beans.xml file, a CDI-style bean that can be defined as a JAX-RS resource as follows:

      Previously this was likely not an issue with an empty beans.xml. However, with the change to the default value of bean-discovery-mode to annotated this may require changes to deployments. If we add @ApplicationPath, @Provider and @Path as bean defining annotation this will allow these to be treated as CDI beans. The one catch is if a type extends jakarta.ws.rs.core.Application and does not have a @ApplicationPath annotation, then it will likely not be discovered.

              jperkins-rhn James Perkins
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: