From 796dbfc748a57f47143a49c17c4764d85120f7d2 Mon Sep 17 00:00:00 2001 From: Tan Cher Shen Date: Wed, 28 Aug 2024 17:46:00 +0800 Subject: [PATCH] feat: update v2 and v4 schema to support LOCAL_PDF_RENDERER --- src/2.0/schema/schema.json | 18 ++- .../__generated__/v4-document.schema.json | 109 +++++++----------- 2 files changed, 56 insertions(+), 71 deletions(-) diff --git a/src/2.0/schema/schema.json b/src/2.0/schema/schema.json index b1b93922..a53e97ad 100644 --- a/src/2.0/schema/schema.json +++ b/src/2.0/schema/schema.json @@ -157,11 +157,27 @@ "type": { "type": "string", "description": "Type of renderer template", - "enum": ["EMBEDDED_RENDERER"] + "enum": ["EMBEDDED_RENDERER", "LOCAL_PDF_RENDERER"] }, "url": { "type": "string", "description": "URL of a decentralised renderer to render this document" + }, + "hash": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["Keccak256"], + "description": "Type of hashing algorithm used for generating the proof value of the local file" + }, + "value": { + "type": "string", + "description": "Proof value of the local file" + } + }, + "required": ["type", "value"], + "additionalProperties": true } }, "required": ["name", "type"] diff --git a/src/4.0/jsonSchemas/__generated__/v4-document.schema.json b/src/4.0/jsonSchemas/__generated__/v4-document.schema.json index a112453a..7fe015a5 100644 --- a/src/4.0/jsonSchemas/__generated__/v4-document.schema.json +++ b/src/4.0/jsonSchemas/__generated__/v4-document.schema.json @@ -65,10 +65,7 @@ "type": "string" } }, - "required": [ - "id", - "type" - ], + "required": ["id", "type"], "additionalProperties": true }, { @@ -83,10 +80,7 @@ "type": "string" } }, - "required": [ - "id", - "type" - ], + "required": ["id", "type"], "additionalProperties": true } } @@ -110,29 +104,17 @@ "properties": { "identityProofType": { "type": "string", - "enum": [ - "DNS-TXT", - "DNS-DID", - "DID" - ] + "enum": ["DNS-TXT", "DNS-DID", "DID"] }, "identifier": { "type": "string" } }, - "required": [ - "identityProofType", - "identifier" - ], + "required": ["identityProofType", "identifier"], "additionalProperties": false } }, - "required": [ - "id", - "type", - "name", - "identityProof" - ], + "required": ["id", "type", "name", "identityProof"], "additionalProperties": false }, "validFrom": { @@ -166,11 +148,7 @@ "description": "Media type (or MIME type) of this attachment" } }, - "required": [ - "data", - "filename", - "mimeType" - ], + "required": ["data", "filename", "mimeType"], "additionalProperties": false } } @@ -192,10 +170,7 @@ "const": "OpenAttestationOcspResponder" } }, - "required": [ - "id", - "type" - ], + "required": ["id", "type"], "additionalProperties": false }, { @@ -211,10 +186,7 @@ "const": "OpenAttestationRevocationStore" } }, - "required": [ - "id", - "type" - ], + "required": ["id", "type"], "additionalProperties": false } ] @@ -231,9 +203,7 @@ "type": "string" } }, - "required": [ - "type" - ], + "required": ["type"], "additionalProperties": true }, { @@ -248,9 +218,7 @@ "type": "string" } }, - "required": [ - "type" - ], + "required": ["type"], "additionalProperties": true } } @@ -268,9 +236,7 @@ "type": "string" } }, - "required": [ - "type" - ], + "required": ["type"], "additionalProperties": true }, { @@ -285,9 +251,7 @@ "type": "string" } }, - "required": [ - "type" - ], + "required": ["type"], "additionalProperties": true } } @@ -302,9 +266,7 @@ "type": "string" } }, - "required": [ - "type" - ], + "required": ["type"], "additionalProperties": true }, { @@ -316,9 +278,7 @@ "type": "string" } }, - "required": [ - "type" - ], + "required": ["type"], "additionalProperties": true } } @@ -344,11 +304,7 @@ "type": "string" } }, - "required": [ - "id", - "type", - "templateName" - ], + "required": ["id", "type", "templateName"], "additionalProperties": false }, { @@ -378,24 +334,37 @@ "description": "An optional multibase-encoded multihash of the SVG image. The multibase value MUST be z and the multihash value MUST be SHA-2 with 256-bits of output (0x12)." } }, - "required": [ - "id", - "type" - ], + "required": ["id", "type"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "OpenAttestationLocalPDFRenderer" + }, + "templateName": { + "type": "string" + }, + "hashType": { + "type": "string", + "enum": ["Keccak256"] + }, + "hashValue": { + "type": "string" + } + }, + "required": ["type", "templateName", "hashType", "hashValue"], "additionalProperties": false } ] } } }, - "required": [ - "@context", - "type", - "issuer", - "credentialSubject" - ], + "required": ["@context", "type", "issuer", "credentialSubject"], "additionalProperties": false } }, "$schema": "http://json-schema.org/draft-07/schema#" -} \ No newline at end of file +}