w3c/vc-data-model

Inconsistency between spec and schema

robdefeo opened this issue · 2 comments

As per schema https://github.com/w3c/vc-data-model/blob/0e6d623d15fb6a3ffadf1249580b5ba55d7894e4/schema/verifiable-credential/verifiable-credential-schema.json#L210C6-L225, credentialSchema does not allow an array. It differs from other fields such as refreshService or termsOfUse where both an array or object are allowed.

    "credentialSchema": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/type"
        }
      },
      "required": [
        "id",
        "type"
      ],
      "additionalProperties": true
    },

However as per the spec in example 22 and https://www.w3.org/TR/vc-data-model-2.0/#data-schemas it states

The value of the credentialSchema property MUST be one or more data schemas...

Please clarify which is correct, the schema.json or the written document.

@decentralgabe do you remember where we landed on this issue?

I think the WG came to consensus on allowing multiple values but staying silent on whether or not one or all of them need to validate? How does vc-json-schema deal with multiple schemas being listed?

I'm going to assign you, @decentralgabe, feel free to re-assign back to me if you don't have a clear understanding of where the WG landed on this question.

I think the WG came to consensus on allowing multiple values but staying silent on whether or not one or all of them need to validate? How does vc-json-schema deal with multiple schemas being listed?

Yes I remember us allowing multiple values.

The language states:

The value of the credentialSchema property MUST be one or more data schemas ...

In terms of validity we have

If multiple schemas are present, validity is determined according to the processing rules outlined by each associated credentialSchema type property.

So we punted and said it's up to the credential schema type in use.

To @robdefeo's point, the JSON Schemas in this repo are out of date. I will self-assign as an action to have them reflect the current CR spec.