diff --git a/modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache b/modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache index 91b9f80bdf1..8c3a1d5e361 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache @@ -67,10 +67,10 @@ {{/minimum}} {{#maximum}} {{#exclusiveMaximum}} - $asserts[] = new Assert\LessThan({{minimum}}); + $asserts[] = new Assert\LessThan({{maximum}}); {{/exclusiveMaximum}} {{^exclusiveMaximum}} - $asserts[] = new Assert\LessThanOrEqual({{minimum}}); + $asserts[] = new Assert\LessThanOrEqual({{maximum}}); {{/exclusiveMaximum}} {{/maximum}} {{#pattern}} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php index 8fbf32d50cb..a7c17cae0b4 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php @@ -224,7 +224,7 @@ class StoreController extends Controller $asserts[] = new Assert\NotNull(); $asserts[] = new Assert\Type("int"); $asserts[] = new Assert\GreaterThanOrEqual(1); - $asserts[] = new Assert\LessThanOrEqual(1); + $asserts[] = new Assert\LessThanOrEqual(5); $response = $this->validate($orderId, $asserts); if ($response instanceof Response) { return $response;