@blockcerts/schemas
Version:
One source of truth for Blockcerts schemas
105 lines (104 loc) • 3.61 kB
JSON
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Blockchain Certificates Certificate Schema, Version 1.2",
"id": "https://w3id.org/blockcerts/schema/1.2/certificate-1.2.json",
"description": "Extends the Open Badges Certificate Schema for certificates on the blockchain",
"type": "object",
"definitions": {
"JsonLdContext": {
"description": "A link to a valid JSON-LD context file, that maps term names to contexts. Blockchain Certificate contexts may also define JSON-schema to validate Blockchain Certificates against. In a Blockchain Certificate Object, this will almost always be a string:uri to a single context file, but might rarely be an array of links or context objects instead. This schema also allows direct mapping of terms to IRIs by using an object as an option within an array.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "object"
},
{
"type": "array"
}
]
}
}
]
},
"JsonLdType": {
"description": "A type or an array of types that the Blockchain Certificate object represents. The first or only item should be 'Certificate', and any others should each be an IRI (usually a URL) corresponding to a definition of the type itself. In almost all cases, there will be only one type: 'Certificate'",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"Issuer": {
"$ref": "https://w3id.org/blockcerts/schema/1.2/issuer-1.2.json"
}
},
"properties": {
"@context": {
"$ref": "#/definitions/JsonLdContext"
},
"type": {
"$ref": "#/definitions/JsonLdType"
},
"id": {
"type": "string",
"format": "uri",
"description": "URI link to a JSON that describes the type of certificate. Default format is https://[domain]/criteria/[year]/[month]/[certificate_title].json. V1.2 change: this field is optional."
},
"name": {
"type": "string",
"description": "Name (or title) of the certificate. V1.2 change: renamed from 'title' to be consistent with OBI schema"
},
"description": {
"type": "string"
},
"image": {
"type": "string",
"pattern": "data:image/png;base64,",
"description": "Data URI; a base-64 encoded png image of the certificate's image. https://en.wikipedia.org/wiki/Data_URI_scheme"
},
"criteria": {
"type": "string",
"format": "uri"
},
"issuer": {
"$ref": "#/definitions/Issuer"
},
"alignment": {
"$ref": "https://openbadgespec.org/v1/schema/badgeclass.json#/definitions/AlignmentArray"
},
"tags": {
"$ref": "https://openbadgespec.org/v1/schema/badgeclass.json#/definitions/TagsArray"
},
"language": {
"type": "string",
"description": "Represents the ieft language and ieft country codes. Format is [ieft_language]-[IEFT_COUNTRY]. V1.2 changes: this field is optional",
"pattern": "[a-z]{2}-[A-Z]{2}"
},
"subtitle": {
"type": "string",
"description": "Subtitle of the certificate. V1.2 changes: this type is now string, and this field is optional"
}
},
"required": [
"name",
"description",
"image",
"issuer"
],
"additionalProperties": true
}