-
Notifications
You must be signed in to change notification settings - Fork 234
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
CSharp | Enum values are invalid after being sanitized #2488
Comments
Thanks for reporting this and for the praises! I believe the issue is multiple folds:
I'm going to focus on the second aspect as it's a more pressing issue at the moment. The code that could write the enum member attribute lives here
It should rely on this information and only add an annotation if this property is true.
Unit tests can be added here.
Lastly the serialization will need to be updated to handle that case. Are you willing to submit a couple of pull requests to address this? CC @andreaTP and @andrueastman for visibility. |
Thanks for the quick response and the pointers @baywet, I will give it a try. |
Just skimmed through, but, if I understand this correctly, this is done in Java:
and the desired encoding for C# looks pretty much matching the current Java encoding. |
…SerializationName is different from CodeEnumOption.Name
…SerializationName is different from CodeEnumOption.Name
…SerializationName is different from CodeEnumOption.Name
#2488 - CSharp | Add EnumMember Attribute if CodeEnumOption.Serializa…
I can see you forked the naming convention aspect into #2495, so we'll keep this issue just for the enum member aspect in dotnet. |
#2488 - Add using statement for EnumMember attribute
First of all, thanks for such a great tool!
Enum values are being sanitized, but don't have an
EnumMember
Attribute on top of them to specify the original name from the spec.Enum value sanitization is also a bit off in my opinion.
For example,
OpenAPI spec
is converted to
Proposed enum in chsarp
The naming is a bit subjective, but it would be cool if Kiota could be more extensible, so one could write some code to customize the generation or namings.
The text was updated successfully, but these errors were encountered: