diff --git a/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/methods/StandardMethodImplementor.java b/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/methods/StandardMethodImplementor.java index c46aadc3c26b1..d12d3a9eb279e 100644 --- a/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/methods/StandardMethodImplementor.java +++ b/extensions/panache/rest-data-panache/deployment/src/main/java/io/quarkus/rest/data/panache/deployment/methods/StandardMethodImplementor.java @@ -41,6 +41,7 @@ public abstract class StandardMethodImplementor implements MethodImplementor { private static final String OPENAPI_RESPONSE_ANNOTATION = OPENAPI_PACKAGE + ".responses.APIResponse"; private static final String OPENAPI_CONTENT_ANNOTATION = OPENAPI_PACKAGE + ".media.Content"; private static final String OPENAPI_SCHEMA_ANNOTATION = OPENAPI_PACKAGE + ".media.Schema"; + private static final String SCHEMA_TYPE_CLASS_NAME = "org.eclipse.microprofile.openapi.annotations.enums.SchemaType"; private static final String SCHEMA_TYPE_ARRAY = "ARRAY"; private static final String ROLES_ALLOWED_ANNOTATION = "jakarta.annotation.security.RolesAllowed"; private static final Logger LOGGER = Logger.getLogger(StandardMethodImplementor.class); @@ -197,7 +198,7 @@ protected void addOpenApiResponseAnnotation(AnnotatedElement element, Response.S .add("implementation", clazz); if (isList) { - schemaAnnotation.add("type", SCHEMA_TYPE_ARRAY); + schemaAnnotation.add("type", schemaTypeArray()); } element.addAnnotation(OPENAPI_RESPONSE_ANNOTATION) @@ -235,6 +236,11 @@ protected boolean isNotReactivePanache() { return !capabilities.isPresent(Capability.HIBERNATE_REACTIVE); } + private static Enum schemaTypeArray() { + Class schemaTypeClass = toClass(SCHEMA_TYPE_CLASS_NAME); + return Enum.valueOf((Class) schemaTypeClass, SCHEMA_TYPE_ARRAY); + } + private static Class toClass(String className) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try {