From 3d5fa92ef7db8b1e3149189efb4a6f32269376e4 Mon Sep 17 00:00:00 2001 From: Martin Rademacher Date: Fri, 1 Dec 2023 10:15:21 +1300 Subject: [PATCH] Add more enum reflection type checks (#1507) --- src/Processors/ExpandEnums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;