From 7b7bcde427f92c338a1ff7897bc6202fcc9cd3f9 Mon Sep 17 00:00:00 2001 From: DerManoMann Date: Fri, 1 Dec 2023 10:09:48 +1300 Subject: [PATCH] Add more enum reflection type checks --- 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;