From 11ee47653d72a3996d5345e5500c0806cec2488f Mon Sep 17 00:00:00 2001 From: franz1981 Date: Mon, 26 Aug 2024 13:49:54 +0200 Subject: [PATCH] Allocates a single OperationIdStrategy converter --- .../smallrye/openapi/runtime/OpenApiConfigMapping.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java b/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java index 41f750378a721..38469501e7ffc 100644 --- a/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java +++ b/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java @@ -20,7 +20,8 @@ */ public class OpenApiConfigMapping extends RelocateConfigSourceInterceptor { private static final Map RELOCATIONS = relocations(); - private final Converter enumConverter = Converters.getImplicitConverter(OperationIdStrategy.class); + private static final Converter OPERATION_ID_STRATEGY_CONVERTER = Converters + .getImplicitConverter(OperationIdStrategy.class); public OpenApiConfigMapping() { super(RELOCATIONS); @@ -32,7 +33,7 @@ public ConfigValue getValue(ConfigSourceInterceptorContext context, String name) // Special case for enum. The converter run after the interceptors, so we have to do this here. if (name.equals(io.smallrye.openapi.api.constants.OpenApiConstants.OPERATION_ID_STRAGEGY)) { if (configValue != null) { - String correctValue = enumConverter.convert(configValue.getValue()).toString(); + String correctValue = OPERATION_ID_STRATEGY_CONVERTER.convert(configValue.getValue()).toString(); configValue = configValue.withValue(correctValue); } }