diff --git a/src/Processors/ExpandEnums.php b/src/Processors/ExpandEnums.php index 05407972..90876a80 100644 --- a/src/Processors/ExpandEnums.php +++ b/src/Processors/ExpandEnums.php @@ -49,7 +49,7 @@ protected function expandContextEnum(Analysis $analysis): void $useName = Generator::isDefault($schemaType) || ($enumType && $this->native2spec($enumType) != $schemaType); $schema->enum = array_map(function ($case) use ($useName) { - return $useName ? $case->name : $case->getBackingValue(); + return ($useName || !($case instanceof \ReflectionEnumBackedCase)) ? $case->name : $case->getBackingValue(); }, $re->getCases()); $schema->type = $useName ? 'string' : $enumType;