fix : correct Link uriVariables for environment POST endpoint

Use toProperty + identifiers instead of fromProperty to resolve
application slug correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 16:43:26 +02:00
parent e99c50d243
commit e9850fdb2e

View File

@@ -21,7 +21,7 @@ use Symfony\Component\Serializer\Attribute\Groups;
new Post(
uriTemplate: '/applications/{slug}/environments',
uriVariables: [
'slug' => new Link(fromClass: Application::class, fromProperty: 'environments'),
'slug' => new Link(toProperty: 'application', fromClass: Application::class, identifiers: ['slug']),
],
security: "is_granted('ROLE_ADMIN')",
),