eclipse-ee4j / eclipse-ee4j/jersey

Resource method returning CompletionStage<SomeType> has CompletionStage instead of SomeType as routing type

Open
#5,159 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Jersey 3.0.8

I have resource methods that return CompletionStage<SomeType>, and MessageBodyWriter's that map to SomeType. However these methods are not considered because the response type is set to CompletionStage and not SomeType when doing the matching to find best method for invoke.

It seems that there is a type unwrap missing somewhere in the process, somewhere around AbstractMethodSelectingRouter.

My current workaround is to ensure all GET methods in the resource returns CompletionStage<>(handling different media types), even though some of them don't need it, so that they are equally disadvantage by not doing the correct type matching.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.