diff --git a/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/impl/processor/ApplicationProcessor.java b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/impl/processor/ApplicationProcessor.java index ff8a1c0597b..aa30ac90d8e 100644 --- a/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/impl/processor/ApplicationProcessor.java +++ b/appserver/payara-appserver-modules/microprofile/openapi/src/main/java/fish/payara/microprofile/openapi/impl/processor/ApplicationProcessor.java @@ -511,7 +511,7 @@ private void vistEnumClass(AnnotationModel schemaAnnotation, EnumType enumType, if (schema != null) { SchemaImpl.merge(schema, newSchema, true, context); } - if (schema == null || schema.getEnumeration().isEmpty()) { + if (schema == null || schema.getEnumeration() == null || schema.getEnumeration().isEmpty()) { //if the schema annotation does not specify enums, then all enum fields will be added for (FieldModel enumField : enumType.getStaticFields()) { final String enumValue = enumField.getName();