-
Notifications
You must be signed in to change notification settings - Fork 74
Description
I'm trying to set up schema validation for OBv3 credentials in our Verifiable Credentials verifier.
The schema section in the OB spec:
https://www.imsglobal.org/spec/ob/v3p0#json-schema-0
says that this schema:
https://purl.imsglobal.org/spec/ob/v3p0/schema/json/ob_v3p0_anyachievementcredential_schema.json
is compatible with VCDM 1.1
But when I look at that schema, it seems to require stuff that is VCDM 2.0 only, like the context definition for example:
"properties": {
"@context": {
"oneOf": [
{
"$ref": "#/$defs/Context"
},
{
"type": "array",
"minItems": 2,
"items": [
{
"enum": ["https://www.w3.org/ns/credentials/v2"]
},
{
"type": "string",
"pattern": "^https:\\/\\/purl\\.imsglobal\\.org\\/spec\\/ob\\/v3p0\\/context(-3\\.\\d\\.\\d)*\\.json$"
}
],
"additionalItems": {
"$ref": "#/$defs/Context"
}
}
]
},
and indeed when I try to validate a V1 VC using that schema it returns quite a few errors, including the context error:
{
"instancePath": "/@context/0",
"schemaPath": "#/anyOf/0/properties/%40context/oneOf/1/items/0/enum",
"keyword": "enum",
"params": {
"allowedValues": [
"https://www.w3.org/ns/credentials/v2"
]
},
"message": "must be equal to one of the allowed values"
},
or, as another example, it seems to requite the validFrom property even though that is also a VC2 property:
{
"instancePath": "",
"schemaPath": "#/anyOf/0/required",
"keyword": "required",
"params": {
"missingProperty": "validFrom"
},
"message": "must have required property 'validFrom'"
},
Have I got the wrong schema definition, or am I not properly understanding something about it?