Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #13060
Closed
Open
Issue created Aug 02, 2022 by Administrator@rootContributor

[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

Assignee
Assign to
Time tracking