Open
Description
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 foldertemplatesNetCore
- Execute command line
- See generated name of property in
MySampleObject.cs
Related issues/PRs
Suggest a fix
There two options:
- Fix naming in code (call attribute
nameInPascalCase
instead ofnameInCamelCase
) - 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.