Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ $apiInstance = new {{invokerPackage}}\Api\{{classname}}(
new GuzzleHttp\Client(){{#hasAuthMethods}},
$config{{/hasAuthMethods}}
);
{{^vendorExtensions.x-group-parameters}}
{{^exts.x-group-parameters}}
{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}}
{{/allParams}}{{#servers}}{{#-first}}
$hostIndex = 0;
$variables = [{{#variables}}
'{{{name}}}' => '{{{default}}}{{^default}}YOUR_VALUE{{/default}}',{{/variables}}
];
{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}
{{/-first}}{{/servers}}{{/exts.x-group-parameters}}{{#exts.x-group-parameters}}
$associative_array = [
{{#allParams}} '{{paramName}}' => {{{example}}}, // {{{dataType}}}{{#description}} | {{{.}}}{{/description}}
{{/allParams}}
Expand All @@ -64,10 +64,10 @@ $associative_array = [
'{{{name}}}' => '{{{default}}}{{^default}}YOUR_VALUE{{/default}}',{{/variables}}
],
{{/-first}}{{/servers}}];
{{/vendorExtensions.x-group-parameters}}
{{/exts.x-group-parameters}}

try {
{{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}$hostIndex, $variables{{/-first}}{{/servers}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associate_array{{/vendorExtensions.x-group-parameters}});{{#returnType}}
{{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{^exts.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#servers}}{{#-first}}{{#allParams}}{{#-first}}, {{/-first}}{{/allParams}}$hostIndex, $variables{{/-first}}{{/servers}}{{/exts.x-group-parameters}}{{#exts.x-group-parameters}}$associate_array{{/exts.x-group-parameters}});{{#returnType}}
print_r($result);{{/returnType}}
} catch (Exception $e) {
echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL;
Expand All @@ -76,10 +76,10 @@ try {

### Parameters

{{#vendorExtensions.x-group-parameters}}
{{#exts.x-group-parameters}}
Note: the input parameter is an associative array with the keys listed as the parameter names below.

{{/vendorExtensions.x-group-parameters}}
{{/exts.x-group-parameters}}
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |{{/-last}}{{/allParams}}
{{#allParams}}| **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}} |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ use PHPUnit\Framework\TestCase;
* {{{summary}}}.
*
*/
public function test{{vendorExtensions.x-test-operation-id}}()
public function test{{exts.x-test-operation-id}}()
{
// TODO: implement
self::markTestIncomplete('Not implemented');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enum {{classname}}: {{vendorExtensions.x-php-enum-type}}
enum {{classname}}: {{exts.x-php-enum-type}}
{
{{#allowableValues}}
{{#enumVars}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,27 +376,27 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
/**
* Gets {{name}}
*
* @return {{{dataType}}}{{^required}}|null{{/required}}
* @return {{{dataType}}}{{#notRequiredOrIsNullable}}|null{{/notRequiredOrIsNullable}}
{{#deprecated}}
* @deprecated
{{/deprecated}}
*/
public function {{getter}}(): {{vendorExtensions.x-php-prop-type}}
public function {{getter}}(): {{exts.x-php-prop-type}}
{
return $this->container['{{name}}'];
}

/**
* Sets {{name}}
*
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{name}}{{#description}} {{{.}}}{{/description}}{{^description}} {{{name}}}{{/description}}
* @param {{{dataType}}}{{#notRequiredOrIsNullable}}|null{{/notRequiredOrIsNullable}} ${{name}}{{#description}} {{{.}}}{{/description}}{{^description}} {{{name}}}{{/description}}
*
* @return $this
{{#deprecated}}
* @deprecated
{{/deprecated}}
*/
public function {{setter}}({{vendorExtensions.x-php-prop-type}} ${{name}}): static
public function {{setter}}({{exts.x-php-prop-type}} ${{name}}): static
{
{{#isNullable}}
if (is_null(${{name}})) {
Expand Down
10 changes: 5 additions & 5 deletions modules/openapi-generator/src/main/resources/php/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{/-last}}
{{/servers}}
{{#allParams}}
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
* @param {{{dataType}}}{{#notRequiredOrIsNullable}}|null{{/notRequiredOrIsNullable}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
{{/allParams}}
{{#servers}}
{{#-first}}
Expand Down Expand Up @@ -215,7 +215,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{/-last}}
{{/servers}}
{{#allParams}}
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
* @param {{{dataType}}}{{#notRequiredOrIsNullable}}|null{{/notRequiredOrIsNullable}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
{{/allParams}}
{{#servers}}
{{#-first}}
Expand Down Expand Up @@ -374,7 +374,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{/-last}}
{{/servers}}
{{#allParams}}
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
* @param {{{dataType}}}{{#notRequiredOrIsNullable}}|null{{/notRequiredOrIsNullable}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
{{/allParams}}
{{#servers}}
{{#-first}}
Expand Down Expand Up @@ -436,7 +436,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{/-last}}
{{/servers}}
{{#allParams}}
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
* @param {{{dataType}}}{{#notRequiredOrIsNullable}}|null{{/notRequiredOrIsNullable}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
{{/allParams}}
{{#servers}}
{{#-first}}
Expand Down Expand Up @@ -526,7 +526,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{/-last}}
{{/servers}}
{{#allParams}}
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
* @param {{{dataType}}}{{#notRequiredOrIsNullable}}|null{{/notRequiredOrIsNullable}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}}
{{/allParams}}
{{#servers}}
{{#-first}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4581,7 +4581,7 @@ public function testAdditionalPropertiesReferenceRequest(
/**
* Operation testBodyWithBinary
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
Expand All @@ -4599,7 +4599,7 @@ public function testBodyWithBinary(
/**
* Operation testBodyWithBinaryWithHttpInfo
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
Expand Down Expand Up @@ -4648,7 +4648,7 @@ public function testBodyWithBinaryWithHttpInfo(
/**
* Operation testBodyWithBinaryAsync
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws InvalidArgumentException
Expand All @@ -4670,7 +4670,7 @@ function ($response) {
/**
* Operation testBodyWithBinaryAsyncWithHttpInfo
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws InvalidArgumentException
Expand Down Expand Up @@ -4710,7 +4710,7 @@ function ($exception) {
/**
* Create request for operation 'testBodyWithBinary'
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws InvalidArgumentException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4429,7 +4429,7 @@ public function testAdditionalPropertiesReferenceRequest($request_body, string $
/**
* Operation testBodyWithBinary
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format
Expand All @@ -4444,7 +4444,7 @@ public function testBodyWithBinary($body, string $contentType = self::contentTyp
/**
* Operation testBodyWithBinaryWithHttpInfo
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format
Expand Down Expand Up @@ -4491,7 +4491,7 @@ public function testBodyWithBinaryWithHttpInfo($body, string $contentType = self
/**
* Operation testBodyWithBinaryAsync
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand All @@ -4510,7 +4510,7 @@ function ($response) {
/**
* Operation testBodyWithBinaryAsyncWithHttpInfo
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -4547,7 +4547,7 @@ function ($exception) {
/**
* Create request for operation 'testBodyWithBinary'
*
* @param \SplFileObject $body image to upload (required)
* @param \SplFileObject|null $body image to upload (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testBodyWithBinary'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand Down
Loading