-
Notifications
You must be signed in to change notification settings - Fork 26
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
Incompatible with kotlinx-serialization #56
Comments
I think that would need to be a separate library. I do wish they'd offer better answers here for 3rd party plugins. What will happen when they break compose? "Sorry this wasn't supported anyway bye". Anvil has experienced similar issues as well. |
Cool, thanks for the quick reply! I'll post here if I end up open-sourcing something |
ZacSweers
changed the title
Allow coexistence with kotlinx-serialization
Incompatible with kotlinx-serialization
Sep 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok so #16 and #24 raised this, but I felt like it was worth reopening since redacting fields in a kotlinx
@Serializable
class actually seems like a very common usecase.The problem: the compiler plugin infrastructure doesn't currently support multiple compiler plugins operating on the same class if they both need to look at the constructors of the class. Kotlinx serialization uses a compiler plugin, so Redacted's compiler breaks.
Possible solution: Add a KSP plugin to generate a new
possiblyRedactedToString()
method for all@Serializable
classes. Then still use a compiler plugin to replacetoString()
but instead of doing it only if a@Redacted
annotation is present, do it for all@Serializable
classes.I think this would work, but it's probably too niche to support for this library. What do you think?
The text was updated successfully, but these errors were encountered: