diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-08-08 06:03:52 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-08-08 06:03:52 +0800 |
commit | f4c2fabbf8f8eccd5cd7c65035e78ad268a34b57 (patch) | |
tree | 853a661c245d5bdc1fb9d165aa204b7761bd91f2 /packages/sra-api/src/responses.ts | |
parent | 0a616ad3b8b87c8142598b535154564cb9276cbe (diff) | |
download | dexon-sol-tools-f4c2fabbf8f8eccd5cd7c65035e78ad268a34b57.tar dexon-sol-tools-f4c2fabbf8f8eccd5cd7c65035e78ad268a34b57.tar.gz dexon-sol-tools-f4c2fabbf8f8eccd5cd7c65035e78ad268a34b57.tar.bz2 dexon-sol-tools-f4c2fabbf8f8eccd5cd7c65035e78ad268a34b57.tar.lz dexon-sol-tools-f4c2fabbf8f8eccd5cd7c65035e78ad268a34b57.tar.xz dexon-sol-tools-f4c2fabbf8f8eccd5cd7c65035e78ad268a34b57.tar.zst dexon-sol-tools-f4c2fabbf8f8eccd5cd7c65035e78ad268a34b57.zip |
Minor refactoring
Diffstat (limited to 'packages/sra-api/src/responses.ts')
-rw-r--r-- | packages/sra-api/src/responses.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/sra-api/src/responses.ts b/packages/sra-api/src/responses.ts index 59c679b9c..03a0cced8 100644 --- a/packages/sra-api/src/responses.ts +++ b/packages/sra-api/src/responses.ts @@ -3,13 +3,14 @@ import { ResponsesObject } from '@loopback/openapi-v3-types'; import { errorResponses } from './errors'; import { headers } from './headers'; -export const generateResponses = (schemaName: string, example: any): ResponsesObject => ({ +export const generateResponses = (schemaName: string, example: any, description: string = 'OK'): ResponsesObject => ({ '200': { headers, - description: 'OK', + description, content: { 'application/json': { schema: { $ref: `#/components/schemas/${schemaName}` }, + example, }, }, }, |