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
  • #8184
Closed
Open
Issue created Dec 14, 2020 by Administrator@rootContributor

[BUG] [JAVA]String type parameter in post request body was generated as Java class type

Created by: simonsonzhang

used cli to create a client sdk jar file: java -jar openapi-generator-cli-5.0.0-beta3.jar generate --input-spec synopsys-coverity-coverity-connect-2020.12-resolved.yaml -g java -o connectAPIclient-2020.12 .

in the swagger yaml file, two String parameters (FilterKey and FilterMatchMode )were defined in the post request body. the only difference is FilterMatchMode is a enum string, it only allows two values ("oneOrMoreMatch" or "noneMatch"), but in the auto Generated java code, the FilterKey was generated as a string type, but FilterMatchMode was generated as a FilterMatchMode class type, both should be generated as String type.

Swagger definition: `

FilterKey string

FilterMatchMode string values: oneOrMoreMatch: (Default) At least one of the values must match the item. noneMatch: None of the values may match the item. Enum:[ oneOrMoreMatch, noneMatch ]

Auto generated JAVA code: @javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-12-12T03:14:15.736Z[GMT]") public class FilterElement { @SerializedName("filterKey") private String filterKey = null;

@SerializedName("matchMode") private FilterMatchMode matchMode = null; `

Assignee
Assign to
Time tracking