eclipse-ee4j / eclipse-ee4j/jersey
Support returning generated Responses with custom Dispatcher
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
I, somewhat masochistically, tried to allow a resource method within Jersey to returns an object which is converted to a Response through the a custom dispatcher/invoker (without the additional logic within the method body); specifically I'm looking to return an rx.Observable which is resolved and built in the invoker. I bound a custom ResourceMethodDispatcher.Provider which seems to work well, **however** it chokes on writing the message because the genericType information from the original declaration is added here: [https://github.com/jersey/jersey/blob/master/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java#L385](https://github.com/jersey/jersey/blob/master/core-server/src/main/java/org/glassfish/jersey/server/model/ResourceMethodInvoker.java#L385) which causes the Jackson provider to bug out.
This could presumably be resolved by registering a writer to handle it but that seems very kludgy. Providing a means to disable the addition of that type information should resolve the issue.
I don't see a good way to handle this (but I may be missing something or doing this totally wrong). It seems as though the invoker is too downstream to have access to the RequestProcessingContext. I can also get together a pull request if the functionality is missing but I could use some design input since I've spent little time poking around Jersey internals.
Contributor guide
Assessment
This issue has not been assessed yet.