eclipse-ee4j / eclipse-ee4j/jersey

jersey-spring should respect @Profile annotations

Open
#3,499 3 comments 0 reactions 0 assignees View on GitHub
Component: extensions Priority: Critical spring Type: Improvement
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

During registration of all jersey resource bindings, the jersey spring integration should make sure to exclude any component for which the proper profile is not active.
This should be both on class and method level.

Current behaviour will just (try to) create a bean behind your back anyway using the Injections abstraction.
In some cases this will fail, because the required dependencies are not (and should not be) available because of the inactive profile.

Expected behaviour:
Any rest endpoint with an @Profile annotation that points to an inactive profile should not be available and thus respond with a 404 if the jersey-spring extension is active.
#### Affected Versions
[2.26-b02]

Contributor guide

Open the contributing guide

Research direction

Start by locating jersey-spring's registration of Jersey resource bindings and how it handles Spring @Profile annotations at class and method level. Reproduce the inactive-profile case described in the issue, then verify that the endpoint is not created and responds with 404 when the jersey-spring extension is active.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.