Skip to content

Commit 62510b2

Browse files
authored
fix(jsonschema): change type to integer in json schema for int backed enums (#5553)
1 parent e4fa5a2 commit 62510b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonSchema/TypeFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private function getClassType(?string $className, bool $nullable, string $format
119119
if (!$this->isResourceClass($className) && is_a($className, \BackedEnum::class, true)) {
120120
$enumCases = array_map(static fn (\BackedEnum $enum): string|int => $enum->value, $className::cases());
121121

122-
$type = \is_string($enumCases[0] ?? '') ? 'string' : 'int';
122+
$type = \is_string($enumCases[0] ?? '') ? 'string' : 'integer';
123123

124124
if ($nullable) {
125125
$enumCases[] = null;

0 commit comments

Comments
 (0)