@@ -358,7 +358,9 @@ public async Task Cannot_create_for_missing_relationship_type()
358
358
ErrorObject error = responseDocument . Errors [ 0 ] ;
359
359
error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
360
360
error . Title . Should ( ) . Be ( "Failed to deserialize request body: Request body must include 'type' element." ) ;
361
- error . Detail . Should ( ) . StartWith ( "Expected 'type' element in 'subscribers' relationship. - Request body: <<" ) ;
361
+ error . Detail . Should ( ) . Be ( "Expected 'type' element in 'subscribers' relationship." ) ;
362
+
363
+ responseDocument . Meta [ "requestBody" ] . ToString ( ) . Should ( ) . NotBeNullOrEmpty ( ) ;
362
364
}
363
365
364
366
[ Fact ]
@@ -400,7 +402,9 @@ public async Task Cannot_create_for_unknown_relationship_type()
400
402
ErrorObject error = responseDocument . Errors [ 0 ] ;
401
403
error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
402
404
error . Title . Should ( ) . Be ( "Failed to deserialize request body: Request body includes unknown resource type." ) ;
403
- error . Detail . Should ( ) . StartWith ( $ "Resource type '{ Unknown . ResourceType } ' does not exist. - Request body: <<") ;
405
+ error . Detail . Should ( ) . Be ( $ "Resource type '{ Unknown . ResourceType } ' does not exist.") ;
406
+
407
+ responseDocument . Meta [ "requestBody" ] . ToString ( ) . Should ( ) . NotBeNullOrEmpty ( ) ;
404
408
}
405
409
406
410
[ Fact ]
@@ -441,7 +445,9 @@ public async Task Cannot_create_for_missing_relationship_ID()
441
445
ErrorObject error = responseDocument . Errors [ 0 ] ;
442
446
error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
443
447
error . Title . Should ( ) . Be ( "Failed to deserialize request body: Request body must include 'id' element." ) ;
444
- error . Detail . Should ( ) . StartWith ( "Expected 'id' element in 'subscribers' relationship. - Request body: <<" ) ;
448
+ error . Detail . Should ( ) . Be ( "Expected 'id' element in 'subscribers' relationship." ) ;
449
+
450
+ responseDocument . Meta [ "requestBody" ] . ToString ( ) . Should ( ) . NotBeNullOrEmpty ( ) ;
445
451
}
446
452
447
453
[ Fact ]
@@ -538,7 +544,9 @@ public async Task Cannot_create_on_relationship_type_mismatch()
538
544
ErrorObject error = responseDocument . Errors [ 0 ] ;
539
545
error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
540
546
error . Title . Should ( ) . Be ( "Failed to deserialize request body: Relationship contains incompatible resource type." ) ;
541
- error . Detail . Should ( ) . StartWith ( "Relationship 'subscribers' contains incompatible resource type 'rgbColors'. - Request body: <<" ) ;
547
+ error . Detail . Should ( ) . Be ( "Relationship 'subscribers' contains incompatible resource type 'rgbColors'." ) ;
548
+
549
+ responseDocument . Meta [ "requestBody" ] . ToString ( ) . Should ( ) . NotBeNullOrEmpty ( ) ;
542
550
}
543
551
544
552
[ Fact ]
@@ -639,7 +647,9 @@ public async Task Cannot_create_with_null_data_in_OneToMany_relationship()
639
647
ErrorObject error = responseDocument . Errors [ 0 ] ;
640
648
error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
641
649
error . Title . Should ( ) . Be ( "Failed to deserialize request body: Expected data[] element for to-many relationship." ) ;
642
- error . Detail . Should ( ) . StartWith ( "Expected data[] element for 'subscribers' relationship. - Request body: <<" ) ;
650
+ error . Detail . Should ( ) . Be ( "Expected data[] element for 'subscribers' relationship." ) ;
651
+
652
+ responseDocument . Meta [ "requestBody" ] . ToString ( ) . Should ( ) . NotBeNullOrEmpty ( ) ;
643
653
}
644
654
645
655
[ Fact ]
@@ -674,7 +684,9 @@ public async Task Cannot_create_with_null_data_in_ManyToMany_relationship()
674
684
ErrorObject error = responseDocument . Errors [ 0 ] ;
675
685
error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
676
686
error . Title . Should ( ) . Be ( "Failed to deserialize request body: Expected data[] element for to-many relationship." ) ;
677
- error . Detail . Should ( ) . StartWith ( "Expected data[] element for 'tags' relationship. - Request body: <<" ) ;
687
+ error . Detail . Should ( ) . Be ( "Expected data[] element for 'tags' relationship." ) ;
688
+
689
+ responseDocument . Meta [ "requestBody" ] . ToString ( ) . Should ( ) . NotBeNullOrEmpty ( ) ;
678
690
}
679
691
680
692
[ Fact ]
@@ -719,7 +731,9 @@ public async Task Cannot_create_resource_with_local_ID()
719
731
ErrorObject error = responseDocument . Errors [ 0 ] ;
720
732
error . StatusCode . Should ( ) . Be ( HttpStatusCode . UnprocessableEntity ) ;
721
733
error . Title . Should ( ) . Be ( "Failed to deserialize request body." ) ;
722
- error . Detail . Should ( ) . StartWith ( "Local IDs cannot be used at this endpoint. - Request body: <<" ) ;
734
+ error . Detail . Should ( ) . Be ( "Local IDs cannot be used at this endpoint." ) ;
735
+
736
+ responseDocument . Meta [ "requestBody" ] . ToString ( ) . Should ( ) . NotBeNullOrEmpty ( ) ;
723
737
}
724
738
}
725
739
}
0 commit comments