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
  • Merge requests
  • !8699

Add object type to imports when value of map is array of objects

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/rgroothuijsen/6192-customTypeMapImport into master Feb 14, 2021
  • Overview 0
  • Commits 2
  • Pipelines 1
  • Changes 5

Created by: rgroothuijsen

This PR fixes a bug that occurs when a method returns a map containing arrays of custom objects, for example Map<int, TestObject[]>. While TestObject in this case is recognized mostly correctly, it is not added to the imports because for the imports it only looks at the array itself, rather than the type of the values held in the array. The result is that the user needs to manually add the import to the generated code.

The parameterized type, in this case, appears to be instead located in additionalProperties.complexType and should be added to the imports whenever the container type is a map and the map's value type is not a built-in type.

This is a fix for issue #6192.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/rgroothuijsen/6192-customTypeMapImport