protected function validateAttributes(): bool
    {
        if (!$this->dataHas('attributes')) {
            return true;
        }

        $attrs = $this->dataGet('attributes');

        if (!is_object($attrs)) {
            $this->memberNotObject('/data', 'attributes');
            return false;
        }

        $disallowed = collect(['type', 'id'])->filter(function ($field) use ($attrs) {
            return property_exists($attrs, $field);
        });

        $this->memberFieldsNotAllowed('/data', 'attributes', $disallowed);

        return $disallowed->isEmpty();
    }