/**
  * @inheritdoc
  */
 public function hasMany($key, $expectedType = null, $required = false, $allowEmpty = false, $acceptable = null)
 {
     $expectedType = $expectedType ?: $key;
     $this->add($key, $this->factory->hasMany($expectedType, $allowEmpty, $acceptable));
     if ($required) {
         $this->required[] = $key;
     }
     return $this;
 }
 /**
  * @inheritDoc
  */
 protected function resource($resourceType, $resourceId = null)
 {
     $resourceValidator = $this->factory->resource($resourceType, $resourceId);
     return $this->factory->resourceDocument($resourceValidator);
 }