w3c / vc-test-suite

Verifiable Credentials WG Test Suite
https://w3c.github.io/vc-test-suite/
BSD 3-Clause "New" or "Revised" License
69 stars 39 forks source link

Is this test actually valid? #109

Closed lemoustachiste closed 3 years ago

lemoustachiste commented 3 years ago

Hi,

so I am working to move our library to compliance with the VC standard. The second test of the basic suite is @context MUST be one or more URIs (negative) https://github.com/w3c/vc-test-suite/blob/gh-pages/test/vc-data-model-1.0/10-basic.js#L39, and the fixture only has one value in the array https://github.com/w3c/vc-test-suite/blob/gh-pages/test/vc-data-model-1.0/input/example-1-bad-cardinality.jsonld#L3.

However if I look at the spec: https://www.w3.org/TR/vc-data-model/#contexts, or even at what vc-js does: https://github.com/digitalbazaar/vc-js/blob/44ca660f62ad3569f338eaaaecb11a7b09949bd2/lib/vc.js#L498, it is not transparent that @context must have more than one value. Actually even the wording of the test spec says "one or more".

Hence my question, is this test actually valid? And why is vc-js marked as passing when no check is explicitly made on the length of the array?

Thanks

lemoustachiste commented 3 years ago

I think this partially answers my question: https://github.com/w3c/vc-test-suite/issues/96. However digging into these negative tests show some inconsistencies between the test suite and the spec, and it's not clear what is the source of truth in those cases.