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
  • #3874
Closed
Open
Issue created Sep 11, 2019 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] Options are not parsed correctly

Created by: ackintosh

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
    • 4.1.2-SNAPSHOT
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

From #japanese slack channel: https://openapi-generator.slack.com/archives/CLTHWFBEJ/p1566966541003500

--type-mappings object=Dict[str, Any],string=String

The parameter above is not parsed correctly.

Expect:

  • object=Dict[str, Any]
  • string=String

Actual:

  • object=Dict[str
  • Any]
  • string=String

It's due to the splitCommaSeparatedList implementation that just split by comma:

https://github.com/OpenAPITools/openapi-generator/blob/046db19a8590f3557ae1e04be75792bbeb39cb69/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/OptionUtils.java#L54-L57

openapi-generator version

4.1.2-SNAPSHOT

Command line used for generation
openapi-generator \
generate \
 --input-spec openapi.yaml \
 --generator-name python \
 --output /local/out \
 --type-mappings object=Dict[str, Any]
Suggest a fix
  • Improve the parsing implementation to respect symbols ([], <>)
  • or use parsing library that satisfy the requirement
Assignee
Assign to
Time tracking