Skip to content

VCDM 1.1 compatible schema doesn't seem to be compatible #608

@jchartrand

Description

@jchartrand

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions