Commit 77edac9
committed
Reject NULL values in arrays unless explicitly allowed
BC break!
The `$bStrictNullTypes` configuration option did not cover
NULL values in arrays, which is unexpected.
This patch adds a new config option `$bStrictNullTypesInArrays`
in JsonMapper, which defaults to `true` and rejects NULL
values in arrays unless explicitly allowed by a nullable type declaration:
`array[?int]`.
This is a backwards compatibility break.
The old behavior can be restored by setting the new configuration
option to `false`.
Resolves: #233
Related: #2111 parent 754d600 commit 77edac9
File tree
4 files changed
+102
-4
lines changed- src
- tests
- support/JsonMapperTest
4 files changed
+102
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
339 | 348 | | |
340 | 349 | | |
341 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
| |||
277 | 285 | | |
278 | 286 | | |
279 | 287 | | |
280 | | - | |
| 288 | + | |
| 289 | + | |
281 | 290 | | |
282 | 291 | | |
283 | 292 | | |
| |||
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
| 328 | + | |
319 | 329 | | |
320 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
321 | 334 | | |
| 335 | + | |
322 | 336 | | |
323 | 337 | | |
324 | 338 | | |
| |||
447 | 461 | | |
448 | 462 | | |
449 | 463 | | |
| 464 | + | |
| 465 | + | |
450 | 466 | | |
| 467 | + | |
451 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
452 | 477 | | |
453 | 478 | | |
454 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
142 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
143 | 176 | | |
144 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
145 | 199 | | |
146 | 200 | | |
147 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
| |||
0 commit comments