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

Sample generation fails #5231

Open
Tracked by #1850
pshao25 opened this issue Feb 6, 2025 · 0 comments
Open
Tracked by #1850

Sample generation fails #5231

pshao25 opened this issue Feb 6, 2025 · 0 comments
Assignees
Labels
Mgmt This issue is related to a management-plane library.

Comments

@pshao25
Copy link
Member

pshao25 commented Feb 6, 2025

Repro steps:

  1. Checkout to [DNM] Compute tsp swagger SDK generation verification azure-rest-api-specs#32432
  2. In the SDK repo, change the path in sdk\compute\Azure.ResourceManager.Compute\src\autorest.md to the local azure-rest-api-specs\specification\compute\resource-manager\readme.md.
  3. Run generation.

Error:

fatal   | System.ArgumentException: An item with the same key has already been added. Key: AutomaticallyApprove
     at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
     at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
     at AutoRest.CSharp.Common.Output.Models.Samples.ExampleValueSnippets.GetExpressionForObjectType(ObjectType objectType, IReadOnlyDictionary`2 valueDict) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.C 
  Sharp\Common\Output\Expressions\Samples\Snippets.ExampleValues.cs:line 418
     at AutoRest.CSharp.Common.Output.Models.Samples.ExampleValueSnippets.GetExpressionForTypeProvider(CSharpType type, InputExampleValue exampleValue) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp 
  \Common\Output\Expressions\Samples\Snippets.ExampleValues.cs:line 346
     at AutoRest.CSharp.Common.Output.Models.Samples.ExampleValueSnippets.GetExpression(CSharpType type, InputExampleValue exampleValue, SerializationFormat serializationFormat, Boolean includeCollectionIn 
  itialization) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Expressions\Samples\Snippets.ExampleValues.cs:line 38
     at AutoRest.CSharp.Common.Output.Models.Samples.ExampleValueSnippets.GetExpressionForObjectType(ObjectType objectType, IReadOnlyDictionary`2 valueDict) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.C 
  Sharp\Common\Output\Expressions\Samples\Snippets.ExampleValues.cs:line 417
     at AutoRest.CSharp.Common.Output.Models.Samples.ExampleValueSnippets.GetExpressionForTypeProvider(CSharpType type, InputExampleValue exampleValue) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp 
  \Common\Output\Expressions\Samples\Snippets.ExampleValues.cs:line 346
     at AutoRest.CSharp.Common.Output.Models.Samples.ExampleValueSnippets.GetExpression(CSharpType type, InputExampleValue exampleValue, SerializationFormat serializationFormat, Boolean includeCollectionIn 
  itialization) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Expressions\Samples\Snippets.ExampleValues.cs:line 38
     at AutoRest.CSharp.Common.Output.Models.Samples.ExampleValueSnippets.GetExpression(ExampleParameterValue exampleParameterValue, SerializationFormat serializationFormat) in D:\a\_work\1\s\autorest.csha 
  rp\src\AutoRest.CSharp\Common\Output\Expressions\Samples\Snippets.ExampleValues.cs:line 221
@ArcturusZhang ArcturusZhang self-assigned this Feb 6, 2025
@ArcturusZhang ArcturusZhang added the Mgmt This issue is related to a management-plane library. label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

No branches or pull requests

2 participants