예제 #1
0
 /**
  * @param \SwaggerAssert\Annotation\Resources\Resource\Models $models
  * @param \SwaggerAssert\Annotation\Resources\Resource\Apis\Api\Operations\Operation $operation
  * @param bool $onlyRequired
  * @return \SwaggerAssert\Container\Expected|bool
  */
 private function pickExpectedRecursively($models, $operation, $onlyRequired)
 {
     // API structure is collection
     if ($operation->hasItemsRef()) {
         return $models->buildExpectedByModelId($operation->itemsRef(), $onlyRequired, true);
     }
     // API structure is hash
     if ($models->exists('id', $operation->type())) {
         return $models->buildExpectedByModelId($operation->type(), $onlyRequired);
     }
     return false;
 }
예제 #2
0
 /**
  * @test
  * @expectedException \SwaggerAssert\Exception\AnnotationException
  * @expectedExceptionMessage specified SWG\Model is not written in your doc.
  */
 public function expectedKeysWithInvalidModelId()
 {
     $this->subject->buildExpectedByModelId('not exists', false);
 }