Skip to content

Commit

Permalink
Add '@context' section for form based request body
Browse files Browse the repository at this point in the history
in /did/create API.
  • Loading branch information
abdulla-ashurov committed Sep 21, 2023
1 parent b1cef44 commit 000f795
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/controllers/issuer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ export class IssuerController {
publicKey: publicKeyHex,
});

if (typeof request.body['@context'] === 'string') {
didDocument['@context'] = [request.body['@context']] ;
}

if (service) {
didDocument.service = [
{
Expand Down
10 changes: 9 additions & 1 deletion src/static/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2477,7 +2477,6 @@
}
},
"DidDocumentWithoutVerificationMethod": {
"description": "This input field contains either a complete DID document, or an incremental change (diff) to a DID document. See <a href=\"https://identity.foundation/did-registration/#diddocument\">Universal DID Registrar specification</a>.",
"type": "object",
"properties": {
"@context": {
Expand Down Expand Up @@ -2609,6 +2608,15 @@
"key": {
"description": "The unique identifier in hexadecimal public key format used in the verification method to create the DID.",
"type": "string"
},
"@context": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"https://www.w3.org/ns/did/v1"
]
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions src/types/swagger-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,12 @@
* key:
* description: The unique identifier in hexadecimal public key format used in the verification method to create the DID.
* type: string
* '@context':
* type: array
* items:
* type: string
* example:
* - https://www.w3.org/ns/did/v1
*
* DidCreateRequest:
* type: object
Expand Down

0 comments on commit 000f795

Please sign in to comment.