-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Labels
Description
Hello,
i'm facing a bug when submitting a PUT request with embedded relation :
data sample posted :
array:7 [
"@context" => "/app_dev.php/contexts/Staking"
"@id" => "/app_dev.php/stakings/10"
"@type" => "Staking"
"id" => 10
"tournaments" => array:1 [
0 => array:4 [
"@id" => "/app_dev.php/staking_tournaments/3"
"@type" => "StakingTournament"
"id" => 3
"tournament" => "/app_dev.php/tournaments/1"
]
]
"name" => "Staking #111"
"mode" => "simple"
]
api-platform returns me the following error :
{
"@context":"\app_dev.php/contexts/Error",
"@type":"Error",
"hydra:title":"An error occurred",
"hydra:description":"No route matches "3".",
...
}
The error is caused by src\Serializer\ItemNormalizer.php
, line 36, using $data['id']
instead of $data['@id']
. In my case, $data['id']
is supposed to be an integer, the PK in database, not a resource URL.