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
  • #5512
Closed
Open
Issue created Mar 03, 2020 by Administrator@rootContributor

[BUG] `nameInCamelCase` generates property in `PascalCase`

Created by: jnnwnk

Bug Report Checklist

Description

There is an attribute called nameInCamelCase in class CodegenProperty. For C# server side generation this results in a name in pascal case. This works for us because we were looking for pascal case anyway, but the name nameInCamelCase is at least misleading.

Input Expected output as camel case Actual output as camel case
myVariableName myVariableName MyVariableName
openapi-generator version

3.0.3

OpenAPI declaration file content or url

https://gist.github.com/jnnwnk/6ee8d7c2102725aa367fc2135648027a

Command line used for generation
java -jar .\openapi-generator-cli-3.0.3.jar generate -i .\openapi.json -g aspnetcore -c .\config.json -o .\output\ -t .\templatesNetCore\
Steps to reproduce
  • Place model.mustache in folder templatesNetCore
  • Execute command line
  • See generated name of property in MySampleObject.cs
Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/3827

Suggest a fix

There two options:

  • Fix naming in code (call attribute nameInPascalCase instead of nameInCamelCase)
  • Fix implementation, so when using nameInCamelCase the generated attribute / property will be using the correct case

Actually it would be nice to have the choice between the well known cases (camelCase, PascalCase, snake_case, SNAKE_CASE_ALL_CAPS, kebap-case). See link for examples. But this might be a feature request instead of a bug.

Assignee
Assign to
Time tracking