diff --git a/components/Credential.yml b/components/Credential.yml index 30ec1f2..fab6ed5 100644 --- a/components/Credential.yml +++ b/components/Credential.yml @@ -58,12 +58,12 @@ components: { "type": "BachelorDegree", "name": "Bachelor of Science and Arts", - }, - }, + } + } } UnsecuredCredential: type: object - description: A W3C Verifiable Credential without a proof. + description: A W3C Verifiable Credential intended for issuance. properties: "@context": type: array @@ -89,6 +89,14 @@ components: "credentialSubject": type: object description: The subject + "proof": + type: object + description: An optional proof for credentials that are secured using proof sets or chains. + oneOf: + - type: object + - type: array + items: + type: object example: { "@context": @@ -107,6 +115,6 @@ components: { "type": "BachelorDegree", "name": "Bachelor of Science and Arts", - }, - }, + } + } } diff --git a/respec-oas.js b/respec-oas.js index 61d33a2..eec80da 100644 --- a/respec-oas.js +++ b/respec-oas.js @@ -285,11 +285,16 @@ function renderJsonSchemaObject(schema) { } else if(schema.oneOf) { objectRendering += ' either '; let itemCount = 0; - for(item of schema.oneOf) { + for(const item of schema.oneOf) { if(item.type === 'string') { objectRendering += 'a string'; } else if(item.type === 'object') { objectRendering += renderJsonSchemaObject(item); + } else if(item.type === 'array') { + objectRendering += 'an array'; + if(item.items) { + objectRendering += ` of ${item.items.type}(s)`; + } } itemCount += 1; @@ -307,7 +312,7 @@ function renderJsonSchemaObject(schema) { } } else { objectRendering += 'an object of the following form:
'; - for(property in schema.properties) { + for(const property in schema.properties) { const value = schema.properties[property]; objectRendering += renderJsonSchemaProperty(property, value); }