Thread
#multiplatform
    chansek

    chansek

    7 months ago
    In my common module of KMM, I have this data class:
    data class UserRole(
        val entity: Entity,                            
        val role: Role,
        val entityId: String
    ) {
    
        fun isAdmin() = role == Role.ADMIN
    }
    When I do serialize it, I get
    admin
    as a property. How can I avoid that?
    Grégory Lureau

    Grégory Lureau

    7 months ago
    Did you try @Transient on the function? (the kotlinx one) What tool do you use for serialization?
    chansek

    chansek

    7 months ago
    This is a Firebase project. Firebase supports @Exclude annotation for Android side, but not sure how to do it in common package.
    Grégory Lureau

    Grégory Lureau

    7 months ago
    Googled and found IgnoreExtraProperties for Firebase.