From c8f2715edcfa668adabfb7dbc28cc7dfaf0aa61e Mon Sep 17 00:00:00 2001 From: abcsun Date: Wed, 4 May 2016 14:52:12 +0800 Subject: [PATCH] fix the minLength validation --- modules/swagger-codegen/src/main/resources/php/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index c0401940b48..0fc827faa90 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -131,7 +131,7 @@ use \{{invokerPackage}}\ObjectSerializer; } {{/maxLength}} {{#minLength}} - if (strlen(${{paramName}}) > {{minLength}}) { + if (strlen(${{paramName}}) < {{minLength}}) { throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); } {{/minLength}}