Skip to content

Conversation

GrimpEreau
Copy link
Contributor

…operty

Q A
Branch? 3.1
Tickets #5464
License MIT
Doc PR

@soyuka soyuka force-pushed the fix/5464-return-bad-request branch 2 times, most recently from f339d97 to 2d77e22 Compare March 20, 2023 09:21
@soyuka soyuka marked this pull request as ready for review March 20, 2023 09:21
@soyuka soyuka force-pushed the fix/5464-return-bad-request branch from 2d77e22 to 46ccd4e Compare March 20, 2023 09:44
@soyuka soyuka changed the title fix(normalizer): return 400 HTTP status code when sending bad type pr… fix(serializer): skip not found properties Mar 20, 2023
$propertyNames = iterator_to_array($this->propertyNameCollectionFactory->create($resourceClass, $options));
// Revert attributes that aren't allowed to be changed after a post-denormalize check
foreach (array_keys($data) as $attribute) {
if (!\in_array($attribute, $propertyNames, true)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!\in_array($attribute, $propertyNames, true)) {
$attribute = $this->nameConverter ? $this->nameConverter->denormalize($attribute) : $attribute;
if (!\in_array($attribute, $propertyNames, true)) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the name converter be used to convert the attribute name to object property name?

@soyuka
Copy link
Member

soyuka commented Mar 27, 2023

we will actually fix that at #5495

@soyuka soyuka closed this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants