UNPKG

@blockcerts/schemas

Version:
113 lines (112 loc) 4.17 kB
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Blockchain Certificates Assertion Schema, Version 1.2", "id": "https://w3id.org/blockcerts/schema/1.2/assertion-1.2.json", "description": "Extends the Open Badges Assertion 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 'Assertion', 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: 'Assertion'", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, "properties": { "@context": { "$ref": "#/definitions/JsonLdContext" }, "type": { "$ref": "#/definitions/JsonLdType" }, "id": { "type": "string", "format": "uri", "description": "URI that links to the certificate on the viewer." }, "uid": { "type": "string", "pattern": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", "description": "Unique identifier, in GUID format. V1.2 change: string pattern changed to guid" }, "issuedOn": { "$ref": "https://openbadgespec.org/v1/schema/assertion.json#/definitions/DateTime", "description": "Date the the certificate JSON was created." }, "evidence": { "type": "string", "format": "uri", "description": "URL of the work that the recipient did to earn the achievement. This can be a page that links out to other pages if linking directly to the work is infeasible. V1.2 made this field optional, which is consistent with OBI spec." }, "expires": { "$ref": "https://openbadgespec.org/v1/schema/assertion.json#/definitions/DateTime", "description": "If the achievement has some notion of expiry, this indicates a date when a badge should no longer be considered valid." }, "image:signature": { "description": "A single signature image, or array of objects with fields image and jobTitle. V1.2 change: support multiple signatures", "oneOf": [ { "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" }, { "type": "array", "items": { "type": "object", "properties": { "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" }, "jobTitle": { "type": "string", "description": "Title of the undersigned. http://schema.org/Person#jobTitle" } } } } ] } }, "required": [ "type", "uid", "issuedOn", "id" ], "additionalProperties": true }