src/Validation/Spec/CreateResourceValidator.php
protected function validateResource(): bool
    {
        $identifier = $this->validateTypeAndId();
        $attributes = $this->validateAttributes();
        $relationships = $this->validateRelationships();

        if ($attributes && $relationships) {
            return $this->validateAllFields() && $identifier;
        }

        return $identifier && $attributes && $relationships;
    }
protected function validateResource(): bool
    {
        $identifier = $this->validateTypeAndId();
        $attributes = $this->validateAttributes();
        $relationships = $this->validateRelationships();

        if ($attributes && $relationships) {
            return $this->validateAllFields() && $identifier;
        }

        return $identifier && $attributes && $relationships;
    }
Validate the resource object.

@return bool