Commit 7d08a55
committed
Bugfix in ModelState validation: before this change, the JADNC filter would only kick in for required attributes, which is incorrect. We didn't have a test for an optional property containing a range validation, where the property default value is not in the required range. In that case, using such a resource as non-toplevel (for example: update relationship) would incorrectly produce a validation error.
1 parent c835ff2 commit 7d08a55
File tree
6 files changed
+27
-36
lines changed- src/JsonApiDotNetCore/Configuration
- test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/ModelState
6 files changed
+27
-36
lines changedLines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 35 | + | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
| 32 | + | |
| 33 | + | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 14 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | 169 | | |
172 | 170 | | |
173 | 171 | | |
| |||
192 | 190 | | |
193 | 191 | | |
194 | 192 | | |
195 | | - | |
| 193 | + | |
196 | 194 | | |
197 | | - | |
| 195 | + | |
198 | 196 | | |
199 | 197 | | |
200 | 198 | | |
| |||
205 | 203 | | |
206 | 204 | | |
207 | 205 | | |
208 | | - | |
| 206 | + | |
209 | 207 | | |
210 | 208 | | |
211 | | - | |
212 | 209 | | |
213 | 210 | | |
214 | 211 | | |
215 | 212 | | |
216 | | - | |
| 213 | + | |
217 | 214 | | |
218 | 215 | | |
219 | 216 | | |
| |||
232 | 229 | | |
233 | 230 | | |
234 | 231 | | |
235 | | - | |
| 232 | + | |
236 | 233 | | |
237 | | - | |
| 234 | + | |
238 | 235 | | |
239 | 236 | | |
240 | 237 | | |
241 | 238 | | |
242 | | - | |
| 239 | + | |
243 | 240 | | |
244 | | - | |
| 241 | + | |
245 | 242 | | |
246 | 243 | | |
247 | 244 | | |
| |||
360 | 357 | | |
361 | 358 | | |
362 | 359 | | |
363 | | - | |
| 360 | + | |
364 | 361 | | |
365 | | - | |
| 362 | + | |
366 | 363 | | |
367 | 364 | | |
368 | 365 | | |
369 | | - | |
| 366 | + | |
370 | 367 | | |
371 | 368 | | |
372 | 369 | | |
373 | 370 | | |
374 | 371 | | |
375 | 372 | | |
376 | 373 | | |
377 | | - | |
378 | | - | |
| 374 | + | |
| 375 | + | |
379 | 376 | | |
380 | 377 | | |
381 | 378 | | |
382 | 379 | | |
383 | 380 | | |
384 | 381 | | |
385 | 382 | | |
386 | | - | |
| 383 | + | |
387 | 384 | | |
388 | 385 | | |
389 | 386 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 23 | | |
28 | 24 | | |
29 | 25 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
0 commit comments