From 1fb86f76ad85d05690c6c13ba0fa8c207a04df21 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Tue, 13 Aug 2024 14:55:08 +0200 Subject: [PATCH] Freeform Map configuration properties always marked as required, fix #42505 --- .../documentation/config/discovery/ResolvedType.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/discovery/ResolvedType.java b/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/discovery/ResolvedType.java index f10b93b94fa68..558e65cd4b42b 100644 --- a/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/discovery/ResolvedType.java +++ b/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/discovery/ResolvedType.java @@ -4,6 +4,8 @@ import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeMirror; +import io.quarkus.annotation.processor.documentation.config.util.TypeUtil; + public record ResolvedType( TypeMirror wrapperType, TypeMirror unwrappedType, @@ -73,7 +75,11 @@ public static ResolvedType makeMap(TypeMirror type, ResolvedType unwrappedResolv unwrappedResolvedType.binaryName, unwrappedResolvedType.qualifiedName, unwrappedResolvedType.simplifiedName, unwrappedResolvedType.isPrimitive, true, unwrappedResolvedType.isList, - unwrappedResolvedType.isOptional, + unwrappedResolvedType.isOptional + // backwards compatibility with versions before Quarkus 3.14 + // see https://github.com/quarkusio/quarkus/issues/42505 + || "java.lang.String".equals(unwrappedResolvedType.qualifiedName) + || TypeUtil.isPrimitiveWrapper(unwrappedResolvedType.qualifiedName), unwrappedResolvedType.isDeclared, unwrappedResolvedType.isInterface, unwrappedResolvedType.isClass, unwrappedResolvedType.isEnum, unwrappedResolvedType.isDuration, unwrappedResolvedType.isConfigGroup); }