TBD54566975 / web5-go

Apache License 2.0
6 stars 6 forks source link

Mixed type properties for DIDs and VCs #109

Open KendallWeihe opened 3 months ago

KendallWeihe commented 3 months ago

This ticket will take the place of the following

Also relevant as a source of inspiration for this work is this PR https://github.com/TBD54566975/web5-go/pull/104


The source of truth as to what web5 will support is codified in the web5-spec repo, and initially created within this PR.

The requirements are as follows:

Note: the only mixed type I see at this time is the issuer in the VC Data Model. As for how we will implement a mixed type here in golang, we do not have a set consensus, but have two separate proposals:

  1. Rely on the caller to perform type assertions; From this PR notice the dids/didcore/document_test.go or dids/didcore/examples_test.go as a reference example
  2. @alecthomas made a separate proposal which is self-evident in his comment here

This work may prove too unwieldy for a single PR, if so then piece meal PRs are appropriate

KendallWeihe commented 3 months ago

We should use the JSON schema to enforce existence requirements, so no need to write custom json marshallers/unmarshallers in this work. Wrote a new ticket for JSON Schema validation https://github.com/TBD54566975/web5-go/issues/131