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
  • #3585
Closed
Open
Issue created Aug 08, 2019 by Administrator@rootContributor

[java][model] Collection initialized to empty collection even if not required

Created by: jmini

We are trying to use the same model between our client (using a model serialized with Jackson) and server (JaxRS jersey2).

If a collection is not required, the server model set its value to null.

https://github.com/OpenAPITools/openapi-generator/blob/7f36f2642209c6d7070e1d76209ba1928d816922/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache#L24-L29

This is not the case on client side.

https://github.com/OpenAPITools/openapi-generator/blob/7f36f2642209c6d7070e1d76209ba1928d816922/modules/openapi-generator/src/main/resources/Java/pojo.mustache#L61

In my opinion this should be aligned.

Assignee
Assign to
Time tracking