-
Notifications
You must be signed in to change notification settings - Fork 221
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
all languages | Generating enums from query parameter #2490
Comments
Thanks for reporting this. It was a design decision at the time since serializing enums comes with constraints (as seen in #2488 ) |
@baywet Thanks for Your answer. Enums with constraints are another big story, but simple serializing works perfectly when an enum is part of a request/response object. Maybe this could be done in this release? |
We can't as it'd be a binary breaking change. Imagine somebody has the existing following code based on a client the generated with kiota var result = await client.Path1.Path2.GetAsync(x => x.QueryParameters.Param1 = "value1"); If we switch the generation to enums, they'll have to update their code to when they refresh their client. Which violates our support policy. var result = await client.Path1.Path2.GetAsync(x => x.QueryParameters.Param1 = EnumType.Value1); The reason that support constraint is so people can update kiota's minor and patch versions trusting it won't break their clients and code. |
@baywet You are right. This is a breaking change for already generated code. |
note additional information for implementation can be found in #2306 |
Now that we've introduced a pattern where we could project both without leading to a breaking change (using obsolete annotations) in #2952, we should reconsider this one for 1.8 |
addressed with #3477 |
When the query parameter is defined as an enum, no code for this enum is generated.
OpenApi spec:
Generates:
where
Type
should beenum
instead ofstring
The text was updated successfully, but these errors were encountered: