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

Generated code using an enum of ints does not compile #3881

Closed
JoshLove-msft opened this issue Oct 30, 2023 · 0 comments · Fixed by #3898
Closed

Generated code using an enum of ints does not compile #3881

JoshLove-msft opened this issue Oct 30, 2023 · 0 comments · Fixed by #3898
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. DPG/RLC v2.1 Post Gallium work DPG v3 Version 3 of AutoRest C# generator.

Comments

@JoshLove-msft
Copy link
Member

JoshLove-msft commented Oct 30, 2023

In Event Grid V2, an enum of ints is defined here - https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L129-L144

This gets generated as a struct with a few well known values.

The convenience method that is generated using the generated ReleaseDelay model. The method calls into the protocol method which defines the delay as an int, but it doesn't use the generated ToSerialInt32 method so the code fails to compile.

@JoshLove-msft JoshLove-msft added the v3 Version 3 of AutoRest C# generator. label Oct 30, 2023
@lirenhe lirenhe added the DPG label Oct 31, 2023
@chunyu3 chunyu3 added DPG/RLC v2.1 Post Gallium work customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Oct 31, 2023
@chunyu3 chunyu3 assigned archerzz and unassigned pshao25 Oct 31, 2023
archerzz added a commit to archerzz/autorest.csharp that referenced this issue Nov 2, 2023
- add missing logic to convert method parameter of int/float enum types from convenience to protocol
- add temporary test case

fix Azure#3881
archerzz added a commit that referenced this issue Nov 10, 2023
…3898)

- add missing logic to convert method parameter of int/float enum types from convenience to protocol
- add temporary test case

fix #3881
live1206 pushed a commit to live1206/autorest.csharp that referenced this issue Dec 11, 2023
…zure#3898)

- add missing logic to convert method parameter of int/float enum types from convenience to protocol
- add temporary test case

fix Azure#3881
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. DPG/RLC v2.1 Post Gallium work DPG v3 Version 3 of AutoRest C# generator.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants