spruceid / ssi

Core library for decentralized identity.
https://spruceid.dev
Apache License 2.0
180 stars 54 forks source link

VC's `termOfUse` type clarification #537

Closed Voronar closed 8 months ago

Voronar commented 9 months ago

According to the https://www.w3.org/TR/vc-data-model/#terms-of-use termsOfUse property MUST specify one or more terms, but in the code https://github.com/spruceid/ssi/blob/main/ssi-vc/src/lib.rs#L76 it is represented exactly as Vec. Maybe OneOrMany type is more appropriate in this case?

sbihel commented 8 months ago

Indeed, and yes you're right a OneOrMany would suffice. But that would make a breaking change, so I would recommend changing the deserialisation to accept a single value with https://docs.rs/serde_with/latest/serde_with/struct.OneOrMany.html. Would you like to open a PR with said change?

(cc @timothee-haudebourg in https://github.com/spruceid/ssi/pull/508 termsOfUse is the opposite, it's a single value)

Voronar commented 8 months ago

Sounds cool. I will do.

Fixed: https://github.com/spruceid/ssi/pull/538

sbihel commented 8 months ago

Thank you, released as part of ssi-vc v0.2.1