Skip to content

Commit

Permalink
Add more enum reflection type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann committed Nov 30, 2023
1 parent 595d8b6 commit 7b7bcde
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 7b7bcde

Please sign in to comment.