Closed frankhinek closed 6 months ago
@andresuribe87 pointed out on Discord that there was a recent discussion on this topic.
I think the proposal makes sense. Crafting a PR to correct the test-vectors to have { }
.
Contrary to didDocumentMetadata
where the spec text is clear about empty metadata structure, the spec text has left room for interpretation wrt how to represent empty
for didDocument
I tend to lean towards using null
over an empty object for didDocument
because it seems more straightforward to check for null
vs. checking to make sure an "object" is empty across languages. Depending on the language, when parsed, "empty object" can be represented as:
@frankhinek @decentralgabe
didDocument
: "If the resolution is unsuccessful, this value MUST be empty."
looks like the draft spec for did resolution also considers this to be null. Reference
For the abundance of clarity, the suggestion is to:
{}
for didDocumentMetadata
.null
for didDocument
.Is this correct?
correct
resolve
function test vectors fordid:jwk
anddid:web
have been committed to the sdk-development repo and others will be added fairly soon. There are inconsistencies in the existing two vectors that would be good to resolve before we modify the SDKs that are consuming these vectors (and cover more DID methods).Per the W3C DID spec, the
resolve
function is expected to return:Section 7.1, DID Resolution of the DID spec states:
Given that it seems that, in the event of an error, the DID Resolution Result of the
resolve
function should look something like this:Referencing the relevant excerpts from the DID spec:
didResolutionMetadata
: "This structure is REQUIRED, and in the case of an error in the resolution process, this MUST NOT be empty."didDocument
: "If the resolution is unsuccessful, this value MUST be empty."didDocumentMetadata
: "If the resolution is unsuccessful, this output MUST be an empty metadata structure."Given the use of the terminology "empty" and "structure" it would seem that an empty object (
{}
) is the most appropriate value to select.