Description
If \ApiPlatform\State\Provider\DeserializeProvider::provide() throws an error, I only get the message "An error occurred" alongside the "trace", but it doesn't specify what the actual issue is.
If I catch it here and print it out, it turns out that the message is "Update is not allowed for this operation."
\ApiPlatform\State\Provider\DeserializeProvider
How to reproduce
Throw an exception in \ApiPlatform\State\Provider\DeserializeProvider::provide().
Possible Solution
Add #[Groups(['jsonld', 'jsonproblem', 'jsonapi'])] attribute to ApiResource/Error::getDescription() method.
ApiResource/Error
#[SerializedName('description')]
#[Groups(['jsonld', 'jsonproblem', 'jsonapi'])]
public function getDescription(): string
{
return $this->detail;
}
API Platform version(s) affected: 4.0.4
Description
If
\ApiPlatform\State\Provider\DeserializeProvider::provide()
throws an error, I only get the message "An error occurred" alongside the "trace", but it doesn't specify what the actual issue is.If I catch it here and print it out, it turns out that the message is "Update is not allowed for this operation."
\ApiPlatform\State\Provider\DeserializeProvider
How to reproduce
Throw an exception in
\ApiPlatform\State\Provider\DeserializeProvider::provide()
.Possible Solution
Add
#[Groups(['jsonld', 'jsonproblem', 'jsonapi'])]
attribute toApiResource/Error::getDescription()
method.ApiResource/Error
Result: