Skip to content

Commit a1fff4b

Browse files
reznikartemJesse Michael
authored andcommitted
Fix wrong variable name in LessThan and LessThanOrEqual asserts (OpenAPITools#3971)
* Fix wrong variable name in LessThan and LessThanOrEqual asserts * After run ./bin/php-symfony-petstore.sh
1 parent 2046e90 commit a1fff4b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/openapi-generator/src/main/resources/php-symfony/api_input_validation.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@
6767
{{/minimum}}
6868
{{#maximum}}
6969
{{#exclusiveMaximum}}
70-
$asserts[] = new Assert\LessThan({{minimum}});
70+
$asserts[] = new Assert\LessThan({{maximum}});
7171
{{/exclusiveMaximum}}
7272
{{^exclusiveMaximum}}
73-
$asserts[] = new Assert\LessThanOrEqual({{minimum}});
73+
$asserts[] = new Assert\LessThanOrEqual({{maximum}});
7474
{{/exclusiveMaximum}}
7575
{{/maximum}}
7676
{{#pattern}}

samples/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public function getOrderByIdAction(Request $request, $orderId)
224224
$asserts[] = new Assert\NotNull();
225225
$asserts[] = new Assert\Type("int");
226226
$asserts[] = new Assert\GreaterThanOrEqual(1);
227-
$asserts[] = new Assert\LessThanOrEqual(1);
227+
$asserts[] = new Assert\LessThanOrEqual(5);
228228
$response = $this->validate($orderId, $asserts);
229229
if ($response instanceof Response) {
230230
return $response;

0 commit comments

Comments
 (0)