[BUG] php-symfony model templates using wrong variable for validation annotation (minimum where should be maximum)
Created by: plotbox-io
Description
Problem found in file: modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache
.
{{#minimum}}
{{#exclusiveMinimum}}
* @Assert\GreaterThan({{minimum}})
{{/exclusiveMinimum}}
{{^exclusiveMinimum}}
* @Assert\GreaterThanOrEqual({{minimum}})
{{/exclusiveMinimum}}
{{/minimum}}
{{#maximum}}
{{#exclusiveMaximum}}
* @Assert\LessThan({{minimum}})
{{/exclusiveMaximum}}
{{^exclusiveMaximum}}
* @Assert\LessThanOrEqual({{minimum}})
{{/exclusiveMaximum}}
{{/maximum}}
Looks like a copy paste error. The two lower instances of minimum
here should instead be maximum
. This causes validation to fail in cases where it should not according to the openapi spec.
Suggest a fix
Submitting PR to fix the template