@@ -301,6 +301,56 @@ public function createProvider(): array
301
301
'source ' => ['pointer ' => '/data/relationships/author/data ' ],
302
302
],
303
303
],
304
+ 'data.relationships.*.data.type:required ' => [
305
+ [
306
+ 'data ' => [
307
+ 'type ' => 'posts ' ,
308
+ 'attributes ' => [
309
+ 'title ' => 'Hello World ' ,
310
+ 'content ' => '... ' ,
311
+ 'slug ' => 'hello-world ' ,
312
+ ],
313
+ 'relationships ' => [
314
+ 'author ' => [
315
+ 'data ' => [
316
+ 'id ' => '123 ' ,
317
+ ],
318
+ ],
319
+ ],
320
+ ],
321
+ ],
322
+ [
323
+ 'title ' => 'Non-Compliant JSON API Document ' ,
324
+ 'detail ' => "The member data must be an object. " ,
325
+ 'status ' => '400 ' ,
326
+ 'source ' => ['pointer ' => '/data/relationships/author/data ' ],
327
+ ],
328
+ ],
329
+ 'data.relationships.*.data.id:required ' => [
330
+ [
331
+ 'data ' => [
332
+ 'type ' => 'posts ' ,
333
+ 'attributes ' => [
334
+ 'title ' => 'Hello World ' ,
335
+ 'content ' => '... ' ,
336
+ 'slug ' => 'hello-world ' ,
337
+ ],
338
+ 'relationships ' => [
339
+ 'author ' => [
340
+ 'data ' => [
341
+ 'type ' => 'users ' ,
342
+ ],
343
+ ],
344
+ ],
345
+ ],
346
+ ],
347
+ [
348
+ 'title ' => 'Non-Compliant JSON API Document ' ,
349
+ 'detail ' => "The member data must be an object. " ,
350
+ 'status ' => '400 ' ,
351
+ 'source ' => ['pointer ' => '/data/relationships/author/data ' ],
352
+ ],
353
+ ],
304
354
'data.relationships.*.data:resource does not exist ' => [
305
355
[
306
356
'data ' => [
@@ -382,6 +432,36 @@ public function createProvider(): array
382
432
'source ' => ['pointer ' => '/data/relationships/tags/data/0 ' ],
383
433
],
384
434
],
435
+ 'data.relationships.*.data.*.id:required ' => [
436
+ [
437
+ 'data ' => [
438
+ 'type ' => 'posts ' ,
439
+ 'attributes ' => [
440
+ 'title ' => 'Hello World ' ,
441
+ 'content ' => '... ' ,
442
+ 'slug ' => 'hello-world ' ,
443
+ ],
444
+ 'relationships ' => [
445
+ 'author ' => [
446
+ 'data ' => null ,
447
+ ],
448
+ 'tags ' => [
449
+ 'data ' => [
450
+ [
451
+ 'type ' => 'tags ' ,
452
+ ],
453
+ ],
454
+ ],
455
+ ],
456
+ ],
457
+ ],
458
+ [
459
+ 'title ' => 'Non-Compliant JSON API Document ' ,
460
+ 'detail ' => "The member type is required. " ,
461
+ 'status ' => '400 ' ,
462
+ 'source ' => ['pointer ' => '/data/relationships/tags/data/0 ' ],
463
+ ],
464
+ ],
385
465
'data.relationships.*.data.*:resource does not exist ' => [
386
466
[
387
467
'data ' => [
0 commit comments