First thanks for a great package.
If I add query string paramaters to the test URL the error "Request URI does not match with any swagger path definition" shows up. Without the query string parameters, the request hits the API.
/**
* Get publications by category
*/
public function testFetchPublicationsByCategory()
{
/** Configure your end point and request parameters */
$requestType = 'GET';
$endPoint = '/publications';
$parameters = [
"request.category" => "001"
];
/** Make the request */
$response = $this->guzzleHttpClient->request($requestType, $this->baseURI.$endPoint, [
'query' => $parameters
]);
$responseBody = json_decode((string) $response->getBody());
/** Do your assertions */
$this->assertResponseBodyMatch($responseBody, self::$schemaManager, '/publications', 'get', 200);
}
"/publications":{
"get":{
"tags":[
"Publications"
],
"operationId":"Publications_ListPublications",
"consumes":[
],
"produces":[
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters":[
{
"name":"request.publisher.id",
"in":"query",
"required":false,
"type":"integer",
"format":"int32"
},
{
"name":"request.publisher.name",
"in":"query",
"required":false,
"type":"string"
},
{
"name":"request.publisher.processingLocation",
"in":"query",
"required":false,
"type":"string"
},
{
"name":"request.category",
"in":"query",
"required":false,
"type":"string"
},
{
"name":"request.pageSize",
"in":"query",
"required":false,
"type":"integer",
"format":"int32"
},
{
"name":"request.pageNo",
"in":"query",
"required":false,
"type":"integer",
"format":"int32"
}
],
"responses":{
"200":{
"description":"OK",
"schema":{
"$ref":"#/definitions/ListPublicationsResponse"
}
}
}
},
"post":{
"tags":[
"Publications"
],
"operationId":"Publications_CreatePublication",
"consumes":[
],
"produces":[
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters":[
],
"responses":{
"200":{
"description":"OK",
"schema":{
"$ref":"#/definitions/CreatePublicationResponse"
}
}
}
}
},
If I remove the "query" => [....] from the Guzzle ->get() call, the API is hit.
Clearly these query string parameters are changing the query URL but then it is failing to find the /publications path in the schema?
Thanks.