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 757c79827c2..bdbe28f85c5 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/api.mustache @@ -711,7 +711,7 @@ use {{invokerPackage}}\ObjectSerializer; {{#queryParams}} // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - ${{paramName}}{{#isEnumRef}}->value{{/isEnumRef}}, + ${{paramName}}{{#isEnumRef}}?->value{{/isEnumRef}}, '{{baseName}}', // param base name '{{#schema}}{{openApiType}}{{/schema}}', // openApiType '{{style}}', // style diff --git a/samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php b/samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php index f0e76da188b..674bdd46d7e 100644 --- a/samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php +++ b/samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php @@ -424,7 +424,7 @@ class QueryApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $enum_ref_string_query->value, + $enum_ref_string_query?->value, 'enum_ref_string_query', // param base name 'StringEnumRef', // openApiType 'form', // style diff --git a/samples/client/echo_api/php-nextgen/src/Api/QueryApi.php b/samples/client/echo_api/php-nextgen/src/Api/QueryApi.php index f0e76da188b..674bdd46d7e 100644 --- a/samples/client/echo_api/php-nextgen/src/Api/QueryApi.php +++ b/samples/client/echo_api/php-nextgen/src/Api/QueryApi.php @@ -424,7 +424,7 @@ class QueryApi ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $enum_ref_string_query->value, + $enum_ref_string_query?->value, 'enum_ref_string_query', // param base name 'StringEnumRef', // openApiType 'form', // style 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 e489439ba14..56833392f95 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 @@ -773,7 +773,7 @@ class FakeApi // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $enum_class->value, + $enum_class?->value, 'enum-class', // param base name 'EnumClass', // openApiType 'form', // style