Skip to content
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

When swagger.json contains "Client" entity, generated C# code doesn't compile #88

Closed
jmalczak opened this issue Jun 2, 2015 · 6 comments

Comments

@jmalczak
Copy link

jmalczak commented Jun 2, 2015

Hey

When I generate client using autorest.exe and swagger.json contains "Client" entity, generated C# code doesn't compile since name of the generated class is Client and each class contains Client property and both can't have the same name. Also where I can find source code of the acctual autorest.exe since I couldn't locate the code in repository?

Thanks a lot

@jmalczak jmalczak changed the title When swagger.json contains When swagger.json contains "Clint" entity, generated C# code doesn't compile Jun 2, 2015
@brenovieira
Copy link

Same problem here. 'Client': member names cannot be the same as their enclosing type

Please edit issue title to "Client" instead of "Clint" (typo).

@matt-gibbs matt-gibbs changed the title When swagger.json contains "Clint" entity, generated C# code doesn't compile When swagger.json contains "Client" entity, generated C# code doesn't compile Jun 3, 2015
@jmalczak
Copy link
Author

jmalczak commented Jun 5, 2015

Where is the source code of autorest.exe tool? I can't locate it in source control?

@matt-gibbs
Copy link
Contributor

Source code is still in private source control. We will get it here in a couple of weeks.

@matt-gibbs
Copy link
Contributor

@jmalczak Is your repro the same as @brenovieira? If not, can you please attach your swagger. We have a fix for the other repro, but want to make sure it covers what you are seeing too.

@jmalczak
Copy link
Author

jmalczak commented Jun 9, 2015

Hey

Unfortunately I can't attach swagger.json, but my case is really simple, one of the services was accessible via http://url/client and due to that generated client class was named Client. I can confirm that it's working when you will publish fix though.

@stankovski
Copy link
Member

@jmalczak
The Client name is based on the title field in swagger. Try changing the title and reopen the issue if it is not resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants