Skip to content

Commit f953a0b

Browse files
committed
review
1 parent 3f25711 commit f953a0b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

features/main/patch.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Feature: Sending PATCH requets
4141
}
4242
}
4343
"""
44-
Then print last JSON response
4544
Then the response status code should be 200
4645
And the response should be in JSON
4746
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"

src/Serializer/SerializerContextBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function createFromRequest(Request $request, bool $normalization, array $
6666
$context['api_allow_update'] = \in_array($method = $request->getMethod(), ['PUT', 'PATCH'], true);
6767

6868
if ($context['api_allow_update'] && 'PATCH' === $method) {
69-
$context[AbstractItemNormalizer::DEEP_OBJECT_TO_POPULATE] = $context[AbstractItemNormalizer::DEEP_OBJECT_TO_POPULATE] ?? true;
69+
$context['deep_object_to_populate'] = $context['deep_object_to_populate'] ?? true;
7070
}
7171
}
7272

@@ -108,7 +108,7 @@ public function createFromRequest(Request $request, bool $normalization, array $
108108
// TODO: We should always use `skip_null_values` but changing this would be a BC break, for now use it only when `merge-patch+json` is activated on a Resource
109109
foreach ($resourceMetadata->getItemOperations() as $operation) {
110110
if ('PATCH' === ($operation['method'] ?? '') && \in_array('application/merge-patch+json', $operation['input_formats']['json'] ?? [], true)) {
111-
$context[AbstractItemNormalizer::SKIP_NULL_VALUES] = true;
111+
$context['skip_null_values'] = true;
112112

113113
break;
114114
}

0 commit comments

Comments
 (0)