From 365a66fab2cc7cbc6ee5567cd42b7eb597aa9a9a Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 26 Feb 2024 09:25:47 +0200 Subject: [PATCH] Take client methods into account in server endpoint indexer 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: #38800 Fixes: #38798 --- .../deployment/QuarkusServerEndpointIndexer.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java index 455e7c3486424..60658a0f0960d 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/QuarkusServerEndpointIndexer.java @@ -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 generatedClassBuildItemBuildProducer; @@ -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); + } + }