src/Factories/Factory.php
public function createExistingResourceDocumentValidator($document, $expectedType, $expectedId)
    {
        $store = $this->container->make(StoreInterface::class);
        $errors = $this->createErrorTranslator();

        return new Validation\Spec\UpdateResourceValidator(
            $store,
            $errors,
            $document,
            $expectedType,
            $expectedId
        );
    }
public function createExistingResourceDocumentValidator($document, $expectedType, $expectedId)
    {
        $store = $this->container->make(StoreInterface::class);
        $errors = $this->createErrorTranslator();

        return new Validation\Spec\UpdateResourceValidator(
            $store,
            $errors,
            $document,
            $expectedType,
            $expectedId
        );
    }
Create a validator to check that a resource document complies with the JSON API specification.

@param object $document
@param string $expectedType
@param string $expectedId
@return Validation\Spec\UpdateResourceValidator