From f2f4762f3528caf506175a8a66e9b2f4639e6141 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Fri, 5 Jan 2024 09:08:40 +0200 Subject: [PATCH] Don't want about missing JSON when returning String Closes: #38044 (cherry picked from commit d53358a8efca70de449c4c5c51184818d7586ebc) --- .../resteasy/reactive/common/processor/EndpointIndexer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java index 0f4dca20e286b..b8dedcde357e2 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/EndpointIndexer.java @@ -1623,6 +1623,9 @@ protected void warnAboutMissingJsonProviderIfNeeded(ResourceMethod method, Metho DefaultProducesHandler jsonDefaultProducersHandler, DefaultProducesHandler.Context context) { if (hasJson(method) || (hasNoTypesDefined(method) && isDefaultJson(jsonDefaultProducersHandler, context))) { + if (STRING.toString().equals(method.getSimpleReturnType())) { // when returning string, we assume that the method implementation is actually handling to conversion + return; + } boolean appProvidedJsonReaderExists = appProvidedJsonProviderExists(getSerializerScanningResult().getReaders()); boolean appProvidedJsonWriterExists = appProvidedJsonProviderExists(getSerializerScanningResult().getWriters()); if (!appProvidedJsonReaderExists || !appProvidedJsonWriterExists) {