Closed EbonyLouis closed 1 week ago
but the actual object that gets created Will have a type of VerifiableCredential
right? (this is the spec)
you should be able to add type VerifiableCredential as a workaround do
val knownCustomerCredential = VerifiableCredential.create(
type = "VerifiableCredential",
issuer = issuerBearerDid.uri.toString(),
subject = customerBearerDid.uri.toString(),
expirationDate = expirationDate,
data = KccCredential("US" , "Gold"),
evidence = evidence,
credentialSchema = CredentialSchema(
id = "https://schema.org/PFI",
type = "JsonSchema"
),
)
@nitro-neal yes @decentralgabe said it's ok for it to have the type verifiableCredential
I don't fully understand why that's ok but the other isn't lol so it makes me think that doing this workaround won't work.
@decentralgabe can you clarify some more please
The VC bible says it so lol: https://www.w3.org/TR/vc-data-model/#types
ah ok perfect I'll use the work around- thanks @nitro-neal
So that we're uniformed across languages, we should still make it optional to provide a value for type
@nitro-neal , @decentralgabe would VerifiableCredential
being duplicated cause a problem?
it may not create a problem it would depend on the LD processor, but we should not have duplicate values if we can avoid it
ok cool so yea we need the SDK updated, cause this work around will create a duplicate
yep, @EbonyLouis confirming you're correct - using this
val vc = VerifiableCredential.create(
type = "VerifiableCredential",
issuer = issuerDid.uri,
subject = holderDid.uri,
data = StreetCredibility(localRespect = "high", legit = true)
)
will create a vc with the vc.vcDataModel that looks like this
calling vc.type
still gets you VerifiableCredential
because the library we happen to be using just gives back the last item on the types list in vc.vcDataModel.types
. but if you need the vc data model, then yea we'd see dupes.
pushing up a pr now :)
@jiyoontbd thank you! šš¾
Purpose
From this slack convo we've discovered that if we pass a value to
type
it will break LD processors who consume it. Since KCC is a JSON-LD construct. Right now we're able to do this in JS but not in KT.Currently:
Desired goal:
thanks š