-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Description
API Platform version(s) affected: 3.0.5 - 3.0.6
Description
I have a resource with following config:
#[ApiResource(
shortName: 'Inventory',
operations: [
new GetCollection(
uriTemplate: '/warehouses/{warehouseId}/inventory',
),
new Get(
uriTemplate: '/warehouses/{warehouseId}/inventory/{id}',
),
],
uriVariables: [
'warehouseId' => new Link(
fromProperty: 'id',
fromClass: WarehouseResource::class,
)
],
normalizationContext: ['groups' => ['inventory:read']],
denormalizationContext: ['groups' => ['inventory:write']],
provider: InventoryResourceProvider::class,
)]
...
After upgrade to v3.0.5, GetCollection endpoint dies with error ( "Unable to generate an IRI for the item of type "App\ApiResource\InventoryResource"",)
Stack:
"Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("id") to generate a URL for route "_api_/warehouses/{warehouseId}/inventory/{id}_get". in /var/www/html/api/vendor/symfony/routing/Generator/UrlGenerator.php:175
Stack trace:
#0 /var/www/html/api/vendor/symfony/routing/Generator/CompiledUrlGenerator.php(67): Symfony\Component\Routing\Generator\UrlGenerator->doGenerate(Array, Array, Array, Array, Array, '_api_/warehouse...', 1, Array, Array)
#1 /var/www/html/api/vendor/symfony/routing/Router.php(225): Symfony\Component\Routing\Generator\CompiledUrlGenerator->generate('_api_/warehouse...', Array, 1)
#2 /var/www/html/api/vendor/api-platform/core/src/Symfony/Routing/Router.php(102): Symfony\Component\Routing\Router->generate('_api_/warehouse...', Array, 1)
#3 /var/www/html/api/vendor/api-platform/core/src/Symfony/Routing/IriConverter.php(187): ApiPlatform\Symfony\Routing\Router->generate('_api_/warehouse...', Array, 1)
#4 /var/www/html/api/vendor/api-pl"
Additional Context
Worked before 3.0.5
Metadata
Metadata
Assignees
Labels
No labels