Commit 717ca76
committed
bug symfony#59501 [Serializer] [ObjectNormalizer] Filter int when using FILTER_BOOL (DjordyKoert)
This PR was submitted for the 7.2 branch but it was squashed and merged into the 7.1 branch instead.
Discussion
----------
[Serializer] [ObjectNormalizer] Filter int when using FILTER_BOOL
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix ...
| License | MIT
Improves on symfony#57541 to also allow numeric values `1` and `0` with `FILTER_BOOL => true`
Currently attempting to use the Serializer component to deserialize to deserialize a `1` or `0` result in the following error:
```
The type of the "booleanProperty" attribute for class "App\MyDTO" must be one of "bool" ("int" given).
```
Commits
-------
5288eba [Serializer] [ObjectNormalizer] Filter int when using FILTER_BOOLFile tree
2 files changed
+24
-11
lines changed- src/Symfony/Component/Serializer
- Normalizer
- Tests/Normalizer
2 files changed
+24
-11
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
| 572 | + | |
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
857 | | - | |
| 857 | + | |
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| |||
Lines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
1219 | 1221 | | |
| 1222 | + | |
1220 | 1223 | | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1221 | 1229 | | |
| 1230 | + | |
| 1231 | + | |
1222 | 1232 | | |
| 1233 | + | |
1223 | 1234 | | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
1224 | 1240 | | |
1225 | 1241 | | |
1226 | 1242 | | |
1227 | 1243 | | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
1228 | 1247 | | |
1229 | 1248 | | |
1230 | 1249 | | |
| |||
1253 | 1272 | | |
1254 | 1273 | | |
1255 | 1274 | | |
1256 | | - | |
1257 | | - | |
1258 | | - | |
1259 | | - | |
| 1275 | + | |
1260 | 1276 | | |
1261 | 1277 | | |
1262 | 1278 | | |
| |||
1279 | 1295 | | |
1280 | 1296 | | |
1281 | 1297 | | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
| 1298 | + | |
1286 | 1299 | | |
1287 | 1300 | | |
1288 | 1301 | | |
| |||
1587 | 1600 | | |
1588 | 1601 | | |
1589 | 1602 | | |
1590 | | - | |
| 1603 | + | |
1591 | 1604 | | |
1592 | 1605 | | |
1593 | 1606 | | |
| |||
0 commit comments