First item of VC context is a URL with the value https://www.w3.org/ns/credentials/v2 #1586
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on a downstream use-case, I noticed that the existing schema checks only that the context contains "https://www.w3.org/ns/credentials/v2", while the v2 spec explicitly says the following regarding context:
With that in mind, I think the use of
prefixItems
to ensure that the first item is the expected URL is more accurate.While there, I also noted that:
hence the "uniqueItems" addition.
Tests still pass with those changes (I was unsure if I should add examples that should fail and update the tests to ensure they fail? Let me know), although I do get the warning:
which appears to be a known ajv issue.
I was also keen to address the last part of the spec for context:
but will do that in another PR if it's wanted.
Finally, where do I sign or agree to the w3c patent policy? (apparently the company I'm working for - gosource.com.au - isn't an affiliate member, but I've created an account at https://www.w3.org/account/request/ and listed gosource as my organisation link, which it allowed, and now linked my GH account)
Thanks