-
-
Notifications
You must be signed in to change notification settings - Fork 957
Closed
Description
I've a Enum as an ApiResource, based on this blog post:
#[Get(routePrefix: '/foobar', provider: FooBarStatus::class . '::getCase'),]
enum FooBarStatus : string
{
/** @param array<string, mixed> $uriVariables */
public static function getCase(Operation $operation, array $uriVariables) : static
{
$name = $uriVariables['id'] ?? null;
$reflectionClass = new ReflectionEnum($operation->getClass());
if ($reflectionClass->getBackingType()->getName() === 'int') {
$name = (int) $name;
}
return self::tryFrom($name);
}
}
In endpoint /api/foobar/foo_bar_status/concept $uriVariables returned
array:1 [▼
"id" => "concept"
]
in 4.1.24, but
array:1 [▼
"id" => 0
]
in 4.2.0.
Can someone explain what should be changed? I've upgraded the api-platform/metadata package to v4.2.0-beta.1 and that's where the issue started.
Metadata
Metadata
Assignees
Labels
No labels