Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller method return type is properly set only for wrapper types #8

Open
Unstopabul opened this issue Feb 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Unstopabul
Copy link

If a KafkaListener method looks like this:
java.util.concurrent.CompletableFuture<ExampleOut>handleExampleIn(@Payload ExampleIn examplein, @Headers Map<String, String> headers);

the resulting controller method looks like this (returning type is ExampleOut which is correct):
public ExampleOut executeExampleIn(@RequestBody ExampleIn examplein,
@RequestParam @Parameter(hidden = true) Map<String, String> params,
HttpServletResponse servletResponse, @RequestHeader Map<String, String> headers) {
kafkaSenderService.send(topicName, examplein, params, servletResponse);
return new ExampleOut();
}

But if a KafkaListener method doesn't use wrappers for the returning type:
ExampleOuthandleExampleIn(@Payload ExampleIn examplein, @Headers Map<String, String> headers);

the resulting controller method return type will be void.

location: pro/axenix_innovation/axenapi/utils/ElementHelper.java -> method getReturnedTypeMirror (the method considers only types with typed arguments, for other types null is returned).

@Unstopabul Unstopabul moved this from Todo to In Progress in AxenAPI Project Feb 8, 2024
@SashaVolushkova SashaVolushkova added the bug Something isn't working label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

No branches or pull requests

2 participants