Nick
11/16/2023, 9:18 PM@Serializable
data class ContactQR(
val did: String? = null,
val displayName: String,
val type: String,
val thid: String? = null,
)
val type: String = ContactType.Personal.value // the assigns the word "Personal" to `type`
val contactQR = ContactQR(
did = userIdentity.did,
type = type,
displayName = profile.displayName,
)
Json.encodeToString(contactQR).also {
println("QR code: $it")
}
Output
{
"did": "did:evan:EiDBY2wGCWTQu3GzNXjHvAfTti009q5vNhOaPVKTp4iesw",
"displayName": "office space"
}
val type: String = ContactType.Personal.value + "asdf"
val contactQR = ContactQR(
did = userIdentity.did,
type = type,
displayName = profile.displayName,
)
Json.encodeToString(contactQR).also {
println("QR code: $it")
}
Output
{
"did": "did:evan:EiDBY2wGCWTQu3GzNXjHvAfTti009q5vNhOaPVKTp4iesw",
"displayName": "office space",
"type": "Personalasdf"
}
ephemient
11/16/2023, 11:46 PM@EncodeDefault
or
Json { encodeDefaults = true }
to see it in the outputNick
11/16/2023, 11:46 PM