Skip to content

Commit

Permalink
Update swagger-jsdoc comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulla-ashurov committed Jul 11, 2023
1 parent 4996eb9 commit 4bea0a1
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 38 deletions.
8 changes: 8 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ const options = {
url: '/'
}
],
tags: [
{
name: 'Credential',
externalDocs: {
url: 'https://github.com/cheqd/credential-service#readme'
}
}
],
info: {
title: 'Credential Service for cheqd network',
version: '2.0.0',
Expand Down
36 changes: 5 additions & 31 deletions src/controllers/issuer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,42 +156,16 @@ export class IssuerController {
* post:
* tags: [ DID ]
* summary: Create a DID.
* description: This endpoint creates a DID by taking DID document or a verification method as an input.
* description: This endpoint creates a DID by taking a set of input parameters or the whole didDocument itself.
* security: [ bearerAuth: [] ]
* requestBody:
* content:
* application/x-www-form-urlencoded:
* schema:
* $ref: '#/components/schemas/DidCreateRequest'
* application/json:
* schema:
* type: object
* required: [ options ]
* properties:
* options:
* type: object
* properties:
* network:
* type: string
* enum: [testnet, mainnet]
* methodSpecificIdAlgo:
* type: string
* enum: [uuid, base58btc]
* secret:
* type: object
* properties:
* verificationMethod:
* type: object
* properties:
* type:
* type: string
* enum: [
* Ed25519VerificationKey2018,
* Ed25519VerificationKey2020,
* JsonWebKey2020S
* ]
* id:
* type: string
* example: key-1
* didDocument:
* $ref: '#/components/schemas/DidDocument'
* $ref: '#/components/schemas/DidCreateRequest'
* responses:
* 200:
* description: The request was successful.
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/revocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class RevocationController {
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/CredentialStatusPublishRequest'
* $ref: '#/components/schemas/CredentialStatusResult'
* 400:
* description: A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.
* content:
Expand Down Expand Up @@ -327,10 +327,10 @@ export class RevocationController {
* content:
* application/x-www-form-urlencoded:
* schema:
* $ref: '#/components/schemas/CredentialStatusPublishRequest'
* $ref: '#/components/schemas/CredentialStatusUpdateRequest'
* application/json:
* schema:
* $ref: '#/components/schemas/CredentialStatusPublishRequest'
* $ref: '#/components/schemas/CredentialStatusUpdateRequest'
* responses:
* 200:
* description: The request was successful.
Expand Down
55 changes: 51 additions & 4 deletions src/types/swagger-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
* type: string
* statusListIndex:
* type: number
* example: 10
* statusListVersion:
* type: string
* statusListRangeStart:
Expand All @@ -73,8 +72,8 @@
* issuerDid: did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0
* subjectDid: did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK
* attributes:
* gender: male
* name: Bob
* gender: male
* name: Bob
* '@context':
* - https://schema.org
* type:
Expand Down Expand Up @@ -354,9 +353,30 @@
* example:
* did: did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e
* name: cheqd-employee-credentials
* version: 2023
* version: '2023'
* data: H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA
* encoding: base64url
* CredentialStatusUpdateRequest:
* type: object
* required:
* - did
* - statusListName
* - indices
* properties:
* did:
* description: The DID of the status list publisher.
* type: string
* statusListName:
* description: The name of the status list to be created.
* type: string
* indices:
* description: Provide the list of indices to be updated.
* type: array
* items:
* type: number
* statusListVersion:
* description: The input field is OPTIONAL, If present uses the provided statusListVersion for the update operation.
* type: string
* KeyResult:
* type: object
* properties:
Expand Down Expand Up @@ -420,6 +440,33 @@
* publicKeyBase58: BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt
* authentication:
* - did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1
* DidCreateRequest:
* type: object
* properties:
* network:
* type: string
* enum:
* - testnet
* - mainnet
* methodSpecificIdAlgo:
* type: string
* enum:
* - uuid
* - base58btc
* verificationMethodType:
* type: string
* enum:
* - Ed25519VerificationKey2018
* - JsonWebKey2020
* - Ed25519VerificationKey2020
* serviceEndpoint:
* type: string
* assertionMethod:
* description: An assertion method is required to issue JSONLD credentials.
* type: boolean
* default: true
* didDocument:
* $ref: '#/components/schemas/DidDocument'
* DidResult:
* type: object
* properties:
Expand Down

0 comments on commit 4bea0a1

Please sign in to comment.