diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index 6c133e34b94..cf5064c94c2 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -299,7 +299,7 @@ use {{invokerPackage}}\ObjectSerializer; {{#allParams}} {{#required}} // verify the required parameter '{{paramName}}' is set - if (${{paramName}} === null) { + if (${{paramName}} === null || (is_array(${{paramName}}) && count(${{paramName}}) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter ${{paramName}} when calling {{operationId}}' ); diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeClassnameTags123Api.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeClassnameTags123Api.md index af8699f0961..b8283f11b4f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeClassnameTags123Api.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeClassnameTags123Api.md @@ -12,6 +12,8 @@ Method | HTTP request | Description To test class name in snake case +To test class name in snake case + ### Example ```php