Skip to content

CSharpClientCodegen: Members with same name as the class will not be renamed. #2348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 10, 2016
Merged

Conversation

nrekretep
Copy link
Contributor

super.postProcessModels needs to be called. Otherwise renaming of members with same name as the class does not take place. Fixed it.

@wing328
Copy link
Contributor

wing328 commented Mar 10, 2016

@nrekretep thanks for the PR.

Can you elaborate a bit on what DATA_TYPE_WITH_ENUM_EXTENSION does? Can you share a spec using this vendor extension?

@wing328 wing328 added this to the v2.1.6 milestone Mar 10, 2016
@nrekretep
Copy link
Contributor Author

This vendor extension has already been inside the code as a string literal. I extracted it into a constant.
As far as I have seen the code it represents the name of the enum class without the question mark. The extension is used to make this enum class available inside the enumClass.template and to represent default values of enum variables in a correct way.

Normally you use the "datatypeWithEnum" attribute of the var. But this client code generator defines all enum variables as nullables. Because of this the value of "datatypeWithEnum" contains a trailing question mark.

The following image shows an example where "defaultWithEnum" contains the questionmark and the default value is set correctly because of the extension.

enumvars-default-value

@wing328
Copy link
Contributor

wing328 commented Mar 10, 2016

@nrekretep thanks for the details.

I'll add a fake model in petstore.json to catch the issue moving forward

wing328 added a commit that referenced this pull request Mar 10, 2016
CSharpClientCodegen: Members with same name as the class will not be renamed.
@wing328 wing328 merged commit 53ef4cf into swagger-api:master Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants