Skip to content

Commit

Permalink
Merge pull request #38995 from geoand/#38798-again
Browse files Browse the repository at this point in the history
Take client methods into account in server endpoint indexer
  • Loading branch information
geoand authored Feb 26, 2024
2 parents 1c5364f + 365a66f commit 3be8518
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 3be8518

Please sign in to comment.