Use of type VerifiableCredential.kt as type for serialization #66
-
Hello walt.id team, i m actually using your SSI KIT in my development for a GAIA-X capable app. Here i tried to use the VerifiableCredential class contained in the SSI KIT repo as a type for serialization. My use case is that i want to store a Verifiable Credential object in my local Postgresql database. I use Postgresql because it is able to store json blobs. For that it has to serialize the object. Here is my table class: val format = Json { prettyPrint = true } object CredentialTable : Table("Verifiable Credentials") { But this is not possbile because the class which is used for serialization needs to have a @serializable annotation (this is not the case in the VerifiableCredential class). I also cannot inherit this class for a new class which could be added with the annotation because of the internal constructor ( Verfiable Credential class has no public one ). My question is: Is there a possibility to get the serialization with your VerifiableCredential class done or do i have to have to write my own VerifiableCredntial class? I appreciate your advice and help. Thank you, Magnus |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi,
|
Beta Was this translation helpful? Give feedback.
Hi,
VerifiableCredential
has 3 methods that can help with serialization:kotlinx.serialization.json.JsonObject
kotlinx.serialization.json.JsonElement
String