You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 replace toString() 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:
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.
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: