Skip to content

Commit 3453cb9

Browse files
phstudywing328
authored andcommitted
fix top-level enum class checking (OpenAPITools#1120)
1 parent c23175f commit 3453cb9

File tree

1 file changed

+1
-1
lines changed
  • modules/openapi-generator/src/main/java/org/openapitools/codegen/utils

1 file changed

+1
-1
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ public static Schema unaliasSchema(Map<String, Schema> allSchemas, Schema schema
652652
if (ref == null) {
653653
LOGGER.warn("{} is not defined", schema.get$ref());
654654
return schema;
655-
} else if (isStringSchema(ref) && (ref.getEnum() != null && !ref.getEnum().isEmpty())) {
655+
} else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) {
656656
// top-level enum class
657657
return schema;
658658
} else if (isArraySchema(ref) || isComposedSchema(ref)) { // array def should be created as models

0 commit comments

Comments
 (0)