Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency between spec and schema #1486

Open
robdefeo opened this issue May 13, 2024 · 2 comments
Open

Inconsistency between spec and schema #1486

robdefeo opened this issue May 13, 2024 · 2 comments
Assignees
Labels
CR1 This item was processed during CR1 editorial Purely editorial changes to the specification.

Comments

@robdefeo
Copy link

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.

@msporny
Copy link
Member

msporny commented May 27, 2024

@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.

@msporny msporny added editorial Purely editorial changes to the specification. CR1 This item was processed during CR1 labels May 27, 2024
@decentralgabe
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR1 This item was processed during CR1 editorial Purely editorial changes to the specification.
Projects
None yet
Development

No branches or pull requests

3 participants