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
  • #5627
Closed
Open
Issue created Mar 18, 2020 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] [DART] Spaces in class names

Created by: SimonIT

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?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

I wanted to generate a dart lib for flutter with the provided swagger yaml config. The problem is, that some of the generated class names contain spaces which are of course not valid. So I had to correct them by hand. Now I'm using swagger to edit the yaml. Swagger suggests to use %20 instead of normal spaces inside $ref definition links. So now, the generator uses also %20 inside class names.

openapi-generator version

4.2.3

OpenAPI declaration file content or url

https://raw.githubusercontent.com/wbt-solutions/openproject_dart_sdk/8e6605a45c72446bf52508dc174542174f4af78c/openProject_swagger.yaml

Command line used for generation

I used the command java -jar .\openapi-generator-cli-4.2.3.jar generate -g dart -i openProject_swagger.yaml -o openproject_dart_sdk/ inside the Windows Powershell.

Steps to reproduce

Execute the command with the provided config and look for example in the api_client.dart. Inside the _deserialize method of the ApiClient you will find some classes with spaces.

Related issues/PRs

Haven't found any.

Suggest a fix

Remove the spaces und uppercase the first letter of every word to match the UpperCamelCase style of dart.

Assignee
Assign to
Time tracking