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
At some point, we introduced the apiName function on some enum classes where the serializable name that is expected by the Mastodon API contains characters we cannot recreate in enum class names (such as posting:default:visibility) and thus cannot easily get the name of those classes by just getting its name.toLowercase().
That approach works well but we need to add those exact lines for every enum class where we want that apiName function.
When implementing a solution for this ticket it would be good if we could reuse the same e.g. extension function so that all enum classes (or at least those enum classes that have the @Serializable annotation and thus a serializer() to begin with) automatically.
The text was updated successfully, but these errors were encountered:
@G10xy An interface wouldn’t really solve our problem of repeating ourselves constantly, unfortunately.
An extension function was what I had in mind. I just don’t know yet if it’s possible to create one only for enum classes that also have the @Serializable annotation but without using reflection. 🤔
At some point, we introduced the
apiName
function on some enum classes where the serializable name that is expected by the Mastodon API contains characters we cannot recreate in enum class names (such asposting:default:visibility
) and thus cannot easily get the name of those classes by just getting itsname.toLowercase()
.The current approach is as such:
That approach works well but we need to add those exact lines for every
enum class
where we want thatapiName
function.When implementing a solution for this ticket it would be good if we could reuse the same e.g. extension function so that all enum classes (or at least those enum classes that have the
@Serializable
annotation and thus aserializer()
to begin with) automatically.The text was updated successfully, but these errors were encountered: