[C#] Added modelPropertyNaming option to the csharp generator#6305
Merged
wing328 merged 1 commit intoswagger-api:masterfrom Aug 15, 2017
MortenHC:master
Merged
[C#] Added modelPropertyNaming option to the csharp generator#6305wing328 merged 1 commit intoswagger-api:masterfrom MortenHC:master
wing328 merged 1 commit intoswagger-api:masterfrom
MortenHC:master
Conversation
…% based of the implementation of the option for Scala
Contributor
|
@MortenHC thanks for the PR. What about making the enhancement to AbstractCSharpCodegen.java so that other C# generators (e.g. NancyFx, etc) can also benefit from this PR? |
Contributor
Author
|
Feel free to move things around. I unfortunately don't have the time to further implement and test the option :) |
Contributor
|
@MortenHC that's ok. We'll see if other contributors can help on this. |
jimschubert
added a commit
to jimschubert/swagger-codegen
that referenced
this pull request
Jan 28, 2018
After PR swagger-api#6305, var names defaulted to PascalCase results in constructor arguments also being PacalCase. Model properties and constructor arguments have no reason to be the same case, and in fact may cause issues (`name = name` will result in a compilation error). This commit forces all constructor params in models to lowerCase. This is a necessary change, for instance, if client SDK consumers assign using named args: var a = new Model(first = "", second = "") The PacalCase default and update to constructor arg casing will break existing consumers of the client. See swagger-api#7070 for more details and discussion.
4 tasks
wing328
pushed a commit
that referenced
this pull request
Feb 6, 2018
* [csharp] ctor params should always be camelCase After PR #6305, var names defaulted to PascalCase results in constructor arguments also being PacalCase. Model properties and constructor arguments have no reason to be the same case, and in fact may cause issues (`name = name` will result in a compilation error). This commit forces all constructor params in models to lowerCase. This is a necessary change, for instance, if client SDK consumers assign using named args: var a = new Model(first = "", second = "") The PacalCase default and update to constructor arg casing will break existing consumers of the client. See #7070 for more details and discussion. * [csharp] Regenerate samples * [csharp] Remove client models generated from a different spec. * [csharp] Escape reserved words on camelcase/lowercase lambdas * [csharp] Regenerate samples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#6281
Almost 100% identical with the implementation of the option in the Scala generator