Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

DeserializeProvider calls PartialDenormalizationException::getErrors(), deprecated in Symfony 8.1

Open Beginner friendly
#8,650 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@dualfroz is already working on this.

Since Oct 10, 2026.

  • #8663 by @dualfroz — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php, symfony
Domain
api, backend

Research direction

Start in src/State/Provider/DeserializeProvider.php at the call around line 110 identified in the issue. Check how the project supports both Symfony Serializer 7.4 and 8.1, then run the relevant tests for invalid input with collect_denormalization_errors: true. Done means those tests pass without the Symfony 8.1 deprecation while Symfony 7.4 remains supported.

Written by the indexing model from the issue text.

Description

API Platform version(s) affected: 4.3.21 and the current head of 4.4 (5.0 is not affected)

Symfony 8.1 deprecates PartialDenormalizationException::getErrors() in favour of getNotNormalizableValueErrors(). The 4.4 branch still calls it: https://github.com/api-platform/core/blob/4.4/src/State/Provider/DeserializeProvider.php#L110

Since symfony/serializer 8.1: The "Symfony\Component\Serializer\Exception\PartialDenormalizationException::getErrors()" method is deprecated, use "Symfony\Component\Serializer\Exception\PartialDenormalizationException::getNotNormalizableValueErrors()" instead.

Every 422 caused by a denormalization error goes through this line, so with collect_denormalization_errors: true it shows up in each test that sends invalid input. 5.0 no longer has the call, but it went away with the rewrite in #8211, which won't be backported.

Possible solution

In Symfony 8.1 getErrors() only returns getNotNormalizableValueErrors(), so the swap is exact. 4.4 also supports symfony/serializer ^7.4, which doesn't have that method, so the fallback would be needed. Yet the fix seems as trivial as

$errors = method_exists($e, 'getNotNormalizableValueErrors')
    ? $e->getNotNormalizableValueErrors()
    : $e->getErrors();

foreach ($errors as $exception) {
    ...
Dominant language
PHP
Stars
2.6k
Forks
987
Avg merge
1d 10h
Merged PRs (30d)
76

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from api-platform/core

All issues in api-platform/core

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.