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
  • #4221
Closed
Open
Issue created Oct 22, 2019 by Administrator@rootContributor

[JavaSpring] Bean Validation with Optional data type

Created by: falaura

Description

When generating code from a .yaml file using bean validation, e.g. maxLength=5, and with useOptional set true the generated code results in @Size(max=5) Optional<String> parameter instead of Optional<@Size(max=5) String> parameter.

openapi-generator version

4.1.3

OpenAPI declaration file content or url

api.yaml

Command line used for generation

openapi-generator generate -g spring -i api.yaml --additional-properties=useOptional=true

Steps to reproduce

Generate files by using command line command. The described problem is found in generated ThingsApi.java

Suggest a fix/enhancement

Changes in the corresponding queryParams.mustache.

Assignee
Assign to
Time tracking