code: protected function validateHasMany(
          RelationshipInterface $relationship,
          $record = null,
          $key = null,
          ResourceObjectInterface $resource = null
      ) {
          if (!$relationship->isHasMany()) {
              $this->addError($this->errorFactory->relationshipHasManyExpected($key));
              return false;
          }
  
          $identifiers = $relationship->getIdentifiers();
  
          if (!$this->validateIdentifiers($identifiers, $record, $key, $resource)) {
              return false;
          }
  
          return true;
      }
docs: Is this a valid has-many relationship?
  
  @param RelationshipInterface $relationship
  @param null $record
  @param null $key
  @param ResourceObjectInterface|null $resource
  @return bool