Skip to content

Commit

Permalink
Take client methods into account in server endpoint indexer
Browse files Browse the repository at this point in the history
The server indexer also picks up REST client methods as
well as there is no bulletproof way of distinguishing
the two.
That is why we now check for client specific annotations

Follows up on: quarkusio#38800
Fixes: quarkusio#38798

(cherry picked from commit 365a66f)
  • Loading branch information
geoand authored and gsmet committed Feb 26, 2024
1 parent 9a7746b commit d662f44
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class QuarkusServerEndpointIndexer
extends ServerEndpointIndexer {

private static final org.jboss.logging.Logger LOGGER = Logger.getLogger(QuarkusServerEndpointIndexer.class);
private static final String REST_CLIENT_NOT_BODY_ANNOTATION = "io.quarkus.rest.client.reactive.NotBody";

private final Capabilities capabilities;
private final BuildProducer<GeneratedClassBuildItem> generatedClassBuildItemBuildProducer;
Expand Down Expand Up @@ -263,4 +264,14 @@ protected void logMissingJsonWarning(MethodInfo info) {
+ "' but no JSON extension has been added. Consider adding 'quarkus-resteasy-reactive-jackson' (recommended) or 'quarkus-resteasy-reactive-jsonb'.");
}

@Override
protected void warnAboutMissUsedBodyParameter(DotName httpMethod, MethodInfo methodInfo) {
// This indexer also picks up REST client methods as well as there is no bulletproof way of distinguishing the two.
// That is why we check for client specific annotations here
if (methodInfo.hasAnnotation(REST_CLIENT_NOT_BODY_ANNOTATION)) {
return;
}
super.warnAboutMissUsedBodyParameter(httpMethod, methodInfo);
}

}

0 comments on commit d662f44

Please sign in to comment.