-
Notifications
You must be signed in to change notification settings - Fork 624
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: Hocon polymorphic serialization #2151
Conversation
I ended up forgetting about this PR. 😅 |
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.
Hi, thanks for the fix! I do not have objections besides minor comments that should be easy to fix.
formats/hocon/src/main/kotlin/kotlinx/serialization/hocon/Hocon.kt
Outdated
Show resolved
Hide resolved
formats/hocon/src/main/kotlin/kotlinx/serialization/hocon/Hocon.kt
Outdated
Show resolved
Hide resolved
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.
Thank you!
Hello!
I know this PR is not exactly what you guys would do to fix the issue with polymorph on HOCON, but I made a quick patch to make it work for us.
The problem is that currently Polymorph kinds are treated as Lists and tries to cast it which won't work since Config will keep it as an object.
Another issue is that the getTag will add a value.tag as the parent when trying to get the correct tag from the config (hence why the ugly and not great boolean "isPolymorph").
That said I would love this issue fixed, so please give me suggestions on how to properly fix it and I'd be more than happy to modify the PR to be up to standards!
This fix refers to #1581.