diff --git a/templates/openapi3/code_php.dot b/templates/openapi3/code_php.dot index 5802466b..327d28e7 100644 --- a/templates/openapi3/code_php.dot +++ b/templates/openapi3/code_php.dot @@ -1,23 +1,20 @@ - '{{=p.exampleValues.object}}', -{{?index < data.allHeaders.length-1}} {{?}}{{~}});{{?}} +{{?index < data.allHeaders.length-1}} {{?}}{{~}}];{{?}} $client = new \GuzzleHttp\Client(); // Define array of request body. -$request_body = array(); +$request_body = []; try { - $response = $client->request('{{=data.methodUpper}}','{{=data.url}}', array( + $response = $client->request('{{=data.methodUpper}}','{{=data.url}}', [ 'headers' => $headers, 'json' => $request_body, - ) - ); + ]); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) {