Azure / autorest.csharp

Extension for AutoRest (https://github.com/Azure/autorest) that generates C# code
MIT License
142 stars 165 forks source link

Duplicate File Generation #161

Open Ellaiyaraja opened 6 years ago

Ellaiyaraja commented 6 years ago

i tried to generate C# code for An Microsoft OPEN API for face detection https://apis.guru/browse-apis/, And i got the follwing error, Please help me in validating OPEN API specification.

<<

System.Exception: Duplicate File Generation: Face.cs at AutoRest.Core.CodeGenerator.d13.MoveNext() in /opt/vsts/work/1/s/autorest.common/src/CodeGenerator.cs:line 151 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at AutoRest.Core.CodeGenerator.d12.MoveNext() in /opt/vsts/work/1/s/autorest.common/src/CodeGenerator.cs:line 121 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at AutoRest.CSharp.CodeGeneratorCs.d14`1.MoveNext() in /opt/vsts/work/1/s/src/vanilla/CodeGeneratorCs.cs:line 86 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at AutoRest.CSharp.CodeGeneratorCs.d12.MoveNext() in /opt/vsts/work/1/s/src/vanilla/CodeGeneratorCs.cs:line 63 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at AutoRest.CSharp.CodeGeneratorCs.d19.MoveNext() in /opt/vsts/work/1/s/src/vanilla/CodeGeneratorCs.cs:line 155 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at AutoRest.CSharp.CodeGeneratorCs.d20.MoveNext() in /opt/vsts/work/1/s/src/vanilla/CodeGeneratorCs.cs:line 188 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at AutoRest.CSharp.Program.d4.MoveNext() in /opt/vsts/work/1/s/src/Program.cs:line 147 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at NewPlugin.d20.MoveNext() in /opt/vsts/work/1/s/autorest.common/src/Plugins/NewPlugin.cs:line 163 FATAL: csharp/generate - FAILED FATAL: Error: Plugin csharp reported failure. Process() cancelled due to exception : Plugin csharp reported failure. Error: Plugin csharp reported failure.

deathly809 commented 6 years ago

@Ellaiyaraja Do you mean this spec? https://api.apis.guru/v2/specs/azure.com/cognitiveservices-Face/1.0/swagger.json

Can you also provide the command you used when running autorest?

Ellaiyaraja commented 6 years ago

Yes. The same spec. you have pointed. autorest --input-file=FaceDetectionMicrosoft.json --csharp --output-folder=CSharp_FaceStore --namespace=faceTest

And Another help,

How can i use "configuration-file.md" file, can you provide me reference to help content.

deathly809 commented 6 years ago

Here is an example of the md file,

https://github.com/Azure/azure-rest-api-specs/blob/master/specification/azurestack/resource-manager/readme.md

You should file this issue over with the csharp extension team, they would have better insight.

https://github.com/Azure/autorest.csharp

fearthecowboy commented 6 years ago

Or you could use the swagger file from the original source: https://github.com/Azure/azure-rest-api-specs/tree/master/specification/cognitiveservices/data-plane/Face

Or just use the autorest-generated SDK : https://www.nuget.org/packages/Microsoft.Azure.CognitiveServices.Vision.Face/2.2.0-preview

deathly809 commented 6 years ago

@fearthecowboy That is no fun!

Ellaiyaraja commented 6 years ago

@microsoftopensource , @olydis

i tried to generate C# code for An Microsoft OPEN API for face detection https://apis.guru/browse-apis/, And i got the Duplicate File Generation error file name called "Face". How to resolve this issue.

deathly809 commented 6 years ago

@Ellaiyaraja Like I said above, you should file an issue with the csharp autorest extension team.

Ellaiyaraja commented 6 years ago

@deathly809 ,

Iam Sorry . Actually i could not find an option to report Issue over C# home, https://github.com/Azure/autorest.csharp.

i don't know exactly how to report, so i just added two C# contributors. @microsoftopensource , @olydis