Ejemplo n.º 1
0
 /**
  * @test
  * @expectedException \KleijnWeb\SwaggerBundle\Exception\InvalidParametersException
  */
 public function cannotOmitBodyWhenExplicitlyMarkedAsRequired()
 {
     $request = new Request();
     $operationDefinition = ['parameters' => [['name' => 'foo', 'required' => true, 'in' => 'query', 'type' => 'int']]];
     $validator = new RequestValidator($operationDefinition);
     $validator->validateRequest($request);
 }
Ejemplo n.º 2
0
 /**
  * @param Request $request
  * @param array   $operationDefinition
  *
  * @throws InvalidParametersException
  * @throws MalformedContentException
  * @throws UnsupportedContentTypeException
  */
 public function process(Request $request, array $operationDefinition)
 {
     $this->coercer->coerceRequest($request, $operationDefinition);
     $this->validator->setOperationDefinition($operationDefinition);
     $this->validator->validateRequest($request);
 }