aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-api/src/responses.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-08 06:03:52 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-08 06:03:52 +0800
commitf4c2fabbf8f8eccd5cd7c65035e78ad268a34b57 (patch)
tree853a661c245d5bdc1fb9d165aa204b7761bd91f2 /packages/sra-api/src/responses.ts
parent0a616ad3b8b87c8142598b535154564cb9276cbe (diff)
downloaddexon-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.ts5
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,
},
},
},