Skip to content

Commit

Permalink
Add more enum reflection type checks (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann authored Nov 30, 2023
1 parent 595d8b6 commit 3d5fa92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Processors/ExpandEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3d5fa92

Please sign in to comment.