Skip to content

Commit cf6e204

Browse files
authored
docs: add skip_null_values in configuration and upgrade-guide (#1618)
1 parent fb52adb commit cf6e204

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

core/configuration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ api_platform:
322322
xkey:
323323
glue: ' '
324324

325-
normalization_context: ~
325+
normalization_context:
326+
# Default value to omit null values in conformance with the JSON Merge Patch RFC.
327+
skip_null_values: true
326328
denormalization_context: ~
327329
swagger_context: ~
328330
openapi_context: ~

core/upgrade-guide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ api_platform:
1515
This will be the default value in 3.0, in 2.7 it's left to `true` so that nothing breaks by updating.
1616
By doing so you won't get access to legacy services and this will probably break things on code using `api-platform/core:2.6`.
1717

18+
In 3.0, in conformance with the JSON Merge Patch RFC, the default value of the `skip_null_values` property is `true` which means that from now on `null` values are omitted during serialization.
19+
```yaml
20+
api_platform:
21+
defaults:
22+
normalization_context:
23+
skip_null_values: true
24+
```
25+
1826
### I'm Migrating From 2.6 and Want to Prepare For 3.0
1927

2028
1. Update the code to 2.7: `composer require api-platform/core:^2.7`

0 commit comments

Comments
 (0)