-
Notifications
You must be signed in to change notification settings - Fork 210
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
Fix: enum serialization #5309
base: main
Are you sure you want to change the base?
Fix: enum serialization #5309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
In the issue you were mentioning that you're having issue implementing a unit test.
Can you please also include the draft unit test in this pull request?
Hey @baywet |
@Kindest13 I've just pushed an example unit test. I think the changes are getting us to the right direction but are not enough yet.
Regardless, all methods need to ALSO accept the serialization object so we can map enum members to their serialization representations, which is not implemented today. Let us know if you have any additional comments or questions. I'd also like @andrueastman opinion on this one. |
I think this also what we were trying to solve with the I agree with making the property default as a collection for now. That requires us to pass extra information to the serializer to differentiate the case 2 and 3. But that is solved with the separate methods for now (once we add the method for Similar to GO we could also generate the string conversion function for the enum but that would lead to a bigger footprint in generation. |
Thank you for the additional information @andrueastman If we focused on "this version of the generation across all languages" I believe we could "align" TypeScript with the changes I've described in my previous reply. Anything I might have missed? Or issues? In your opinion. |
gentle reminder on the last question @andrueastman |
@baywet Do we still deciding on the approach? |
Thank you for your patience, I'll try to recap the situation the best I can so the next steps are clear. Here is what I believe we should have at the generation level:
At the serialization libraries level, during serialization:
At the serialization libraries level, during deserialization:
With all that in mind, here is how I suggest we proceed:
Let us know if you have any additional comments or questions. And thanks for the nudge here. |
This looks good from my end @baywet.
I think for this one we can simply have the implementation split the strings first. Adding another method would probably have something like In summary we should have something like this.
|
Thanks for chiming in @andrueastman |
Fixes microsoft/kiota-typescript#1276