Skip to content
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

Feature similar to gson TypeAdapter #2261

Closed
hazra-mms opened this issue Apr 4, 2023 · 1 comment
Closed

Feature similar to gson TypeAdapter #2261

hazra-mms opened this issue Apr 4, 2023 · 1 comment

Comments

@hazra-mms
Copy link

hazra-mms commented Apr 4, 2023

What is your use-case and why do you need this feature?
We are currently using gson for serialization/deserialization in our project and was considering the kotlinx serialization as an alternative to this. We has a requirement where we convert field name for some of the objects for special use case ( i.e. replacing $ in a field name by \uFF04) which is currently implemented by implementing TypeAdapter and registering that type adapter in the GsonBuilder. Does kotlinx serialization have something similar?
Describe the solution you'd like
Would like to have some feature which would be able to accept specific type adapter in the factory while creating the json instance.

In case there are such feature available please feel free to update the ticket accordingly. Thank you.

@sandwwraith
Copy link
Member

No, we do not have any kind of global configuration. You can use any methods described in the documentation to override serializer: @file:UseSerializers, custom type alias, or contextual configuration.

also, it was discussed a bit here: #507, so I'll close this as a duplicate

@sandwwraith sandwwraith closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants