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

[BUG][kotlin-spring] Generating schema model with additional properties in component leads to compile error

Created by: Alexichlol

Description

Generating schema model with additional properties leads to compile error.

Steps to reproduce: swagger.yaml:

JsonObjectItem:
      description: example item of Json Object (could be anything)
      properties:
        something1:
          type: string
        something2:
          type: string
      additionalProperties:
        type: string

generates

`data class JsonObjectItem (

    @JsonProperty("something1") val something1: kotlin.String? = null,

    @JsonProperty("something2") val something2: kotlin.String? = null

) : kotlin.mapOf<String, kotlin.String>{

}`

which leads to

JsonObjectItem.kt: (23, 12): Unresolved reference: mapOf

openapi-generator version

4.1.3

OpenAPI declaration file content or url

--> https://gist.github.com/Alexichlol/a4ce6f2a3742cc28a757fa736923a436

Command line used for generation

gradle plugin

Steps to reproduce

in description but basically just generate code and try to compile

Related issues/PRs
Suggest a fix

don't really know the idea behind current implementation but maybe either not using data class if want to inherit from map and inherit from hashmap like in spring java or use composition and have map as the field

Assignee
Assign to
Time tracking