-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Kotlin - kotlinx.serialization - polymorphism #14301
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
base: master
Are you sure you want to change the base?
Kotlin - kotlinx.serialization - polymorphism #14301
Conversation
The Serializer check the mapping value in the discriminator field of the json we received to find the children Serializer
Would really love to see this change get in. |
@loicsiret thanks for the PR. Can you please PM me via Slack to discuss this further? https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g |
Did this conversation happen? |
Yes, just need some time for improving tests
Le lun. 14 août 2023, 16:53, Tyler Thrailkill ***@***.***> a
écrit :
… Did this conversation happen?
—
Reply to this email directly, view it on GitHub
<#14301 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7JLFUD4F4SZNYRDMKGB7DXVKF27ANCNFSM6AAAAAATE4QSNU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@snowe2010 if you've time to contribute a test or 2, please reply to let us know. |
I am not snowe2010, however I'd be interested in helping with some tests. |
The fact is that there are a lot of change in the code that impact this PR,
I'm working on it !
Le jeu. 26 oct. 2023 à 09:33, Manuel Dossinger ***@***.***> a
écrit :
… I am not snowe2010, however I'd be interested in helping with some tests.
—
Reply to this email directly, view it on GitHub
<#14301 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7JLFUQT3OKFHZMBXGOFZLYBJRBFAVCNFSM6AAAAAATE4QSNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRGEZTMMJYGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Two years since this PR was opened. Why not merged? |
@RuterFrode there's no test added in this PR. Can you file a new PR on top of this one and add some tests please? |
Currently Kotlin multiplatform didn't support Polymorphic Serializer.
I have implemented the polymorphic support by using JsonContentPolymorphicSerializer from kotlinx.serialization
You can check the sample :
samples/client/petstore/kotlin-multiplatform-polymorphic
One thing I'm not confident is the modification in
data_class.mustache
concerning the use of the parent constructorPR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(6.3.0) (minor release - breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks)@jimschubert, @dr4ke616 @karismann @Zomzog @andrewemery @4brunu @yutaka0m
#14548