Skip to content

Commit

Permalink
fix: swagger file
Browse files Browse the repository at this point in the history
Signed-off-by: DaevMithran <[email protected]>
  • Loading branch information
DaevMithran committed Oct 17, 2022
1 parent 6940ed0 commit 1380ec6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 42 deletions.
3 changes: 2 additions & 1 deletion src/controllers/did.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class DidController {
break
case DidDocumentOperation.Remove:
resolvedDocument = jsonSubtract(resolvedDocument.didDocument, didDocument)
break
}
i++
}
Expand All @@ -71,7 +72,7 @@ export class DidController {

await CheqdRegistrar.instance.update(signInputs, didPayload)

return response.status(200).json({
return response.status(201).json({
jobId: null,
didState: {
did: didPayload.id,
Expand Down
2 changes: 1 addition & 1 deletion src/service/cheqd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class CheqdRegistrar {
export async function CheqdResolver(id: string) {
const result = await fetch(`${DefaultResolverUrl.Cheqd}/${id}`)
if (!result.ok) {
console.log("HTTP-Error: " + result.status)
return null
}
return await result.json()
}
60 changes: 20 additions & 40 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,13 @@
"description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateState"
}
}
}
},
"500": {
"description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateState"
}
}
}
}
Expand Down Expand Up @@ -98,19 +92,14 @@
"description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateState"
}
}
}
},
"500": {
"description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateState"
}

}
}
}
Expand Down Expand Up @@ -146,19 +135,13 @@
"description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeactivateState"
}
}
}
},
"500": {
"description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeactivateState"
}
}
}
}
Expand Down Expand Up @@ -218,24 +201,37 @@
},
"options": {
"description": "This input field contains an object with various options for the DID update operation. See <a href=\"https://identity.foundation/did-registration/#options\">https://identity.foundation/did-registration/#options</a>.",
"type": "object"
"type": "object",
"items": {
"network": {
"type": "string"
}
},
"example": {
"network": "testnet"
}
},
"secret": {
"description": "This input field contains an object with DID controller keys and other secrets needed for performing the DID update operation. See <a href=\"https://identity.foundation/did-registration/#secret\">https://identity.foundation/did-registration/#secret</a>.",
"type": "object",
"items": {
"keys" : {
"type": "array"
}
},
"example": {
"keys": {
"keys": [{
"publicKey": "",
"privateKey": ""
}
}]
}
},
"didDocumentOperation": {
"description": "This input field indicates which update operation should be applied to a DID’s associated DID document. See <a href=\"https://identity.foundation/did-registration/#diddocumentoperation\">https://identity.foundation/did-registration/#diddocumentoperation</a>.",
"type": "array",
"items": {
"type": "string",
"example": []
"example": ["addToDidDocument"]
}
},
"didDocument": {
Expand All @@ -245,31 +241,15 @@
"type": "object"
},
"example": {
"jobId": "null",
"did": "did:cheqd:testnet:zApY6E8Prv1rWcjRtBKENGaVm2kRk1VQ",
"options": {
"network": "testnet"
},
"secret": {
"keys": [{
"publicKey": "5E8KLz/YVQJH8eklJi2Ny2QYVdEtYRqIF7lBj5lfMU8",
"privateKey": "QWt4TjVLMTZYTzVXY1RReGlhU1VmYm1IYmRRQk14ejPkTwovP9hVAkfx6SUmLY3LZBhV0S1hGogXuUGPmV8xTw"
}]
},
"didDocumentOperation": [
"addToDidDocument"
],
"didDocument": [{
"service": [{
"id": "did:cheqd:testnet:zApY6E8Prv1rWcjRtBKENGaVm2kRk1VQ#rand",
"type": "rand",
"serviceEndpoint": "https://rand.in"
}]
}]
}
}
}
}
},
},
"DeactivateRequest": {
"description": "Input fields for the deactivate operation.",
"type": "object",
Expand Down

0 comments on commit 1380ec6

Please sign in to comment.