Problem/Motivation

Discovered while working on #2930028: Comprehensive JSON API integration test coverage phase 1: for every entity type, individual resources only.

Like the REST module did before #2827084: EntityNormalizer::denormalize should not throw UnexpectedValueException, but \Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException, so we get a 422 response instead of 400, the JSON API module sends a 422 response when either decoding or denormalizing fails. But that's wrong: it should be 400 for failed decoding, and 422 for failed denormalization. See #2827084.

Proposed resolution

Fix \Drupal\jsonapi\Controller\RequestHandler::deserializeBody().

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Issue summary: View changes
wim leers’s picture