diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache index e08efd963782..ce84b768d951 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache @@ -131,10 +131,10 @@ use {{invokerPackage}}\ObjectSerializer; * {{.}} * {{/description}} -{{#vendorExtensions.x-group-parameters}} +{{#exts.x-group-parameters}} * Note: the input parameter is an associative array with the keys listed as the parameter name below * -{{/vendorExtensions.x-group-parameters}} +{{/exts.x-group-parameters}} {{#servers}} {{#-first}} * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. @@ -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}} @@ -168,15 +168,15 @@ use {{invokerPackage}}\ObjectSerializer; * * @throws ApiException on non-2xx response or if the response body is not in the expected format * @throws InvalidArgumentException - * @return {{{vendorExtensions.x-php-doc-return-type}}} + * @return {{{exts.x-php-doc-return-type}}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} */ public function {{operationId}}( - {{^vendorExtensions.x-group-parameters}} + {{^exts.x-group-parameters}} {{#allParams}} - {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, + {{exts.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}} {{#servers}} {{#-first}} @@ -185,14 +185,14 @@ use {{invokerPackage}}\ObjectSerializer; {{/-first}} {{/servers}} string $contentType = self::contentTypes['{{{operationId}}}'][0] - {{/vendorExtensions.x-group-parameters}} - {{#vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} + {{#exts.x-group-parameters}} array $associative_array - {{/vendorExtensions.x-group-parameters}} - ): {{{vendorExtensions.x-php-return-type}}} + {{/exts.x-group-parameters}} + ): {{{exts.x-php-return-type}}} { - {{^vendorExtensions.x-php-return-type-is-void}}list($response) = {{/vendorExtensions.x-php-return-type-is-void}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{^vendorExtensions.x-php-return-type-is-void}} - return $response;{{/vendorExtensions.x-php-return-type-is-void}} + {{^exts.x-php-return-type-is-void}}list($response) = {{/exts.x-php-return-type-is-void}}$this->{{operationId}}WithHttpInfo({{^exts.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/exts.x-group-parameters}}{{#exts.x-group-parameters}}$associative_array{{/exts.x-group-parameters}});{{^exts.x-php-return-type-is-void}} + return $response;{{/exts.x-php-return-type-is-void}} } /** @@ -206,10 +206,10 @@ use {{invokerPackage}}\ObjectSerializer; * {{.}} * {{/description}} -{{#vendorExtensions.x-group-parameters}} +{{#exts.x-group-parameters}} * Note: the input parameter is an associative array with the keys listed as the parameter name below * -{{/vendorExtensions.x-group-parameters}} +{{/exts.x-group-parameters}} {{#servers}} {{#-first}} * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. @@ -231,7 +231,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}} @@ -249,9 +249,9 @@ use {{invokerPackage}}\ObjectSerializer; {{/isDeprecated}} */ public function {{operationId}}WithHttpInfo( - {{^vendorExtensions.x-group-parameters}} + {{^exts.x-group-parameters}} {{#allParams}} - {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, + {{exts.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}} {{#servers}} {{#-first}} @@ -260,13 +260,13 @@ use {{invokerPackage}}\ObjectSerializer; {{/-first}} {{/servers}} string $contentType = self::contentTypes['{{{operationId}}}'][0] - {{/vendorExtensions.x-group-parameters}} - {{#vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} + {{#exts.x-group-parameters}} array $associative_array - {{/vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} ): array { - $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + $request = $this->{{operationId}}Request({{^exts.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/exts.x-group-parameters}}{{#exts.x-group-parameters}}$associative_array{{/exts.x-group-parameters}}); try { $options = $this->createHttpClientOption(); @@ -379,10 +379,10 @@ use {{invokerPackage}}\ObjectSerializer; * {{.}} * {{/description}} -{{#vendorExtensions.x-group-parameters}} +{{#exts.x-group-parameters}} * Note: the input parameter is an associative array with the keys listed as the parameter name below * -{{/vendorExtensions.x-group-parameters}} +{{/exts.x-group-parameters}} {{#servers}} {{#-first}} * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. @@ -404,7 +404,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}} @@ -421,9 +421,9 @@ use {{invokerPackage}}\ObjectSerializer; {{/isDeprecated}} */ public function {{operationId}}Async( - {{^vendorExtensions.x-group-parameters}} + {{^exts.x-group-parameters}} {{#allParams}} - {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, + {{exts.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}} {{#servers}} {{#-first}} @@ -432,13 +432,13 @@ use {{invokerPackage}}\ObjectSerializer; {{/-first}} {{/servers}} string $contentType = self::contentTypes['{{{operationId}}}'][0] - {{/vendorExtensions.x-group-parameters}} - {{#vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} + {{#exts.x-group-parameters}} array $associative_array - {{/vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} ): PromiseInterface { - return $this->{{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + return $this->{{operationId}}AsyncWithHttpInfo({{^exts.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/exts.x-group-parameters}}{{#exts.x-group-parameters}}$associative_array{{/exts.x-group-parameters}}) ->then( function ($response) { return $response[0]; @@ -457,10 +457,10 @@ use {{invokerPackage}}\ObjectSerializer; * {{.}} * {{/description}} -{{#vendorExtensions.x-group-parameters}} +{{#exts.x-group-parameters}} * Note: the input parameter is an associative array with the keys listed as the parameter name below * -{{/vendorExtensions.x-group-parameters}} +{{/exts.x-group-parameters}} {{#servers}} {{#-first}} * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. @@ -482,7 +482,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}} @@ -499,9 +499,9 @@ use {{invokerPackage}}\ObjectSerializer; {{/isDeprecated}} */ public function {{operationId}}AsyncWithHttpInfo( - {{^vendorExtensions.x-group-parameters}} + {{^exts.x-group-parameters}} {{#allParams}} - {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, + {{exts.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}} {{#servers}} {{#-first}} @@ -510,14 +510,14 @@ use {{invokerPackage}}\ObjectSerializer; {{/-first}} {{/servers}} string $contentType = self::contentTypes['{{{operationId}}}'][0] - {{/vendorExtensions.x-group-parameters}} - {{#vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} + {{#exts.x-group-parameters}} array $associative_array - {{/vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} ): PromiseInterface { $returnType = '{{{returnType}}}'; - $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + $request = $this->{{operationId}}Request({{^exts.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/exts.x-group-parameters}}{{#exts.x-group-parameters}}$associative_array{{/exts.x-group-parameters}}); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -563,10 +563,10 @@ use {{invokerPackage}}\ObjectSerializer; /** * Create request for operation '{{{operationId}}}' * -{{#vendorExtensions.x-group-parameters}} +{{#exts.x-group-parameters}} * Note: the input parameter is an associative array with the keys listed as the parameter name below * -{{/vendorExtensions.x-group-parameters}} +{{/exts.x-group-parameters}} {{#servers}} {{#-first}} * This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host. @@ -588,7 +588,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}} @@ -605,9 +605,9 @@ use {{invokerPackage}}\ObjectSerializer; {{/isDeprecated}} */ public function {{operationId}}Request( - {{^vendorExtensions.x-group-parameters}} + {{^exts.x-group-parameters}} {{#allParams}} - {{vendorExtensions.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, + {{exts.x-php-param-type}} ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}, {{/allParams}} {{#servers}} {{#-first}} @@ -616,13 +616,13 @@ use {{invokerPackage}}\ObjectSerializer; {{/-first}} {{/servers}} string $contentType = self::contentTypes['{{{operationId}}}'][0] - {{/vendorExtensions.x-group-parameters}} - {{#vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} + {{#exts.x-group-parameters}} array $associative_array - {{/vendorExtensions.x-group-parameters}} + {{/exts.x-group-parameters}} ): Request { - {{#vendorExtensions.x-group-parameters}} + {{#exts.x-group-parameters}} // unbox the parameters from the associative array {{#allParams}} ${{paramName}} = array_key_exists('{{paramName}}', $associative_array) ? $associative_array['{{paramName}}'] : {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}; @@ -631,7 +631,7 @@ use {{invokerPackage}}\ObjectSerializer; $variables = array_key_exists('variables', $associative_array) ? $associative_array['variables'] : []; {{/servers.0}} $contentType = $associative_array['contentType'] ?? self::contentTypes['{{{operationId}}}'][0]; - {{/vendorExtensions.x-group-parameters}}{{#allParams}} + {{/exts.x-group-parameters}}{{#allParams}} {{#required}} // verify the required parameter '{{paramName}}' is set if (${{paramName}} === null || (is_array(${{paramName}}) && count(${{paramName}}) === 0)) { diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/api_doc.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/api_doc.mustache index 539b91cc7fff..af99e07c192b 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/api_doc.mustache @@ -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}} @@ -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; @@ -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}} | diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/api_test.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/api_test.mustache index a9aab8044a48..ca88ceb05424 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/api_test.mustache @@ -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'); diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/model_enum.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/model_enum.mustache index d0a24379e609..cf8b0a7484b1 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/model_enum.mustache @@ -1,4 +1,4 @@ -enum {{classname}}: {{vendorExtensions.x-php-enum-type}} +enum {{classname}}: {{exts.x-php-enum-type}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache index a08517fc7609..73448b8df168 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache @@ -376,12 +376,12 @@ 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}}']; } @@ -389,14 +389,14 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par /** * 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}})) { diff --git a/modules/openapi-generator/src/main/resources/php/api.mustache b/modules/openapi-generator/src/main/resources/php/api.mustache index 8c3377c45c17..ccae14d1424b 100644 --- a/modules/openapi-generator/src/main/resources/php/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/api.mustache @@ -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}} @@ -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}} @@ -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}} @@ -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}} @@ -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}} diff --git a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Api/FakeApi.php b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Api/FakeApi.php index 46d603ec1002..5d11eef1670f 100644 --- a/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Api/FakeApi.php +++ b/samples/client/petstore/php-nextgen/OpenAPIClient-php/src/Api/FakeApi.php @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 5b1bfac6808a..a445ef5ed6e3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -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 @@ -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 @@ -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 @@ -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 @@ -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