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

Invalid definition of context in schema #1059

Closed
xaviaracil opened this issue Mar 6, 2023 · 2 comments · Fixed by #1064
Closed

Invalid definition of context in schema #1059

xaviaracil opened this issue Mar 6, 2023 · 2 comments · Fixed by #1064
Assignees
Labels
conversation question ready for PR This issue is ready for a Pull Request to be created to resolve it

Comments

@xaviaracil
Copy link

xaviaracil commented Mar 6, 2023

Context is defined in the spec as an array of string or objects (https://www.w3.org/TR/vc-data-model/#contexts):

The value of the @context property MUST be an ordered set where the first item is a URI with the value https://www.w3.org/2018/credentials/v1. For reference, a copy of the base context is provided in Appendix B.1 Base Context. Subsequent items in the array MUST express context information and be composed of any combination of URIs or objects. It is RECOMMENDED that each URI in the @context be one which, if dereferenced, results in a document containing machine-readable information about the @context.

However, the schema restricts @context to be only an array of strings (https://github.com/w3c/vc-data-model/blob/main/schema/verifiable-credential/verifiable-credential-schema.json#L139-L148):

"@context": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "contains": {
        "const": "https://www.w3.org/2018/credentials/v1"
      },
      "minItems": 1
    },

Schema should be fixed to allow also objects in the array.

@Sakurann
Copy link
Contributor

an explicit sentence in the specification that says "do not use anything other than JSON-LD @context values" might be helpful.

@decentralgabe
Copy link
Contributor

dropped the string requirement here #1064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conversation question ready for PR This issue is ready for a Pull Request to be created to resolve it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants