aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-api/src/responses.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sra-api/src/responses.ts')
-rw-r--r--packages/sra-api/src/responses.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/sra-api/src/responses.ts b/packages/sra-api/src/responses.ts
new file mode 100644
index 000000000..59c679b9c
--- /dev/null
+++ b/packages/sra-api/src/responses.ts
@@ -0,0 +1,17 @@
+import { ResponsesObject } from '@loopback/openapi-v3-types';
+
+import { errorResponses } from './errors';
+import { headers } from './headers';
+
+export const generateResponses = (schemaName: string, example: any): ResponsesObject => ({
+ '200': {
+ headers,
+ description: 'OK',
+ content: {
+ 'application/json': {
+ schema: { $ref: `#/components/schemas/${schemaName}` },
+ },
+ },
+ },
+ ...errorResponses,
+});