Closed
Description
Hey there,
Forgive me if I read incorrectly, but I don't think there's any documentation about validating relationships as part of a new resource creation, such as the request body shown in the example under http://jsonapi.org/format/#document-resource-objects
The current solution I'm using is to manually construct the relationships validator and set it on the main resource validator. eg.
$validator = $this->getResourceObjectValidator(...)
$validator->setRelationshipsValidator(new RelationshipsValidator([
'relationshipName' => $this->getHasOneValidator('relationship_type')
]);
Although I'm not 100% sure that this is the recommended method.
If you would like me to submit a change to README to that effect under content validation, I'm happy to do that too.
Metadata
Metadata
Assignees
Labels
No labels