swagger-api / swagger-api/swagger-codegen
[C#] modelPropertyNaming not honored in v2.4.1 SNAPSHOT
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
It seems that between versions 2.3.1 and 2.4.1, modelPropertyNaming stopped working. We haven't changed a thing - in fact, I tried this with the very same definition file from a few months back that was fine with 2.3.1 - and all of the method parameters are now coming back as camelCase instead of the setting we use of PascalCase.
This is the second problem we've had with the CodeGen API using 2.4.1 today, the other being that any classes named "Void" are no longer being renamed (eg "ModelVoid") to avoid conflicts.
Please consider not using a SNAPSHOT as a code base for the API and online generator. Or, better, allow access via the URL to earlier, stable versions.
Swagger-codegen version
Using the online version. Last time we used our code creation utility, v2.3.1 was in use. Today it was v2.4.1 SNAPSHOT.
Swagger declaration file content or url
This isn't really relevant as the issue is evident using the exact same definition file with the only difference being the version of CodeGen in use
Command line used for generation
Steps to reproduce
Also not relevant; we submit a URL of the definition file via the API:
http://generator.swagger.io/api/gen/clients/csharp
with the following arguments:
packageName = {OurAppName}
targetFramework = "v4.5"
modelPropertyNaming = "PascalCase"
nonPublicApi = False
sortParamsByRequiredFlag = True
useCollection = False
validatable = False
optionalAssemblyInfo = False
optionalProjectFile = False
optionalEmitDefaultValues = False`
Suggest a fix/enhancement
- Fix or revert the changed code to honor the previous setting
modelPropertyNamingdirective. - Please only use stable, release generator code versions with the online and API generators.
- Please consider providing an option to target a specific generator code version.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the C# generator exposed at http://generator.swagger.io/api/gen/clients/csharp and compare handling of modelPropertyNaming between 2.3.1 and 2.4.1-SNAPSHOT. Verify that the same definition and PascalCase setting produce PascalCase model properties, and assess the request for stable or selectable generator versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100