This specification defines a [[JsonSchema]] based credential schema validation scheme for use with the credential schema property of Verifiable Credentials
Verifiable Credentials enable assurnace that the exchange of data between parties has occured without any tampering.
Issuers , Holders and Verifiers might want to exchange a credential schema by reference as part of a policy coordination or code sharing effort.
JSON Schema calls their specification versions "drafts" and publishes them by year, see [[JsonSchema]].
Open API Specification depends on [[JsonSchema]], see [[OAS]].
While both YAML and JSON are supported, implementations SHOULD use YAML for schemas that are meant to be read and edited by humans.
Per the guidance from yaml.org,
implementations SHOULD use .yaml
as the file extension.
This term definition is https://www.w3.org/ns/credentials/issuer-dependent#JsonSchema
.
JsonSchema is used for validation of W3C Verifiable Credentials, based on the latest version of the living standard.
An issuer MAY include a credentialSchema of type {{JsonSchema}}.
This term definition is https://www.w3.org/ns/credentials/issuer-dependent#JsonSchema2020
.
JsonSchema2020 is
for validation of W3C Verifiable Credentials, based on JSON Schema version 2020-12
.
An issuer MAY include a credentialSchema of type {{JsonSchema2020}}.
... "credentialSchema": { "id": "https://vendor.example/schemas/credential.yaml", "type": "JsonSchema2020" } ...
A JSON Document complies with this specification if
it follows the normative guidance in [[VC-DATA-MODEL]]
and implements the associated version of [[!JsonSchema]]
specified by the credential schema type
property,
as described in {{JsonSchema}} and {{JsonSchema2020}}.
Due to the dependency on the W3C Verifiable Credentials @context, the following aliases are inherited.
Issuers might leverage @context to change term definitions, or the shape the RDF graph produced from [[JSON-LD]].
This is how to valdiate a credential using ajv-validator/ajv-cli.