From c2ce5ca8f172b17089eca5d8382ea95c62d4f077 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 29 Jul 2024 10:38:16 +0300 Subject: [PATCH] Treat Kotlin's Unit as void for the Quarkus REST scoring system Fixes: #42159 --- .../core/startup/RuntimeResourceDeployment.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java index 041796659ddf34..abe1546f868963 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java @@ -565,8 +565,16 @@ private static void smartInitParameterConverter(int i, ParameterConverter quarku } private static boolean isNotVoid(Class rawEffectiveReturnType) { - return rawEffectiveReturnType != Void.class - && rawEffectiveReturnType != void.class; + if (rawEffectiveReturnType == Void.class) { + return false; + } + if (rawEffectiveReturnType == void.class) { + return false; + } + if ("kotlin.Unit".equals(rawEffectiveReturnType.getName())) { + return false; + } + return true; } private void addResponseHandler(ServerResourceMethod method, List handlers) {