aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-api/src/responses.ts
blob: 59c679b9c709f4f0c1bd495cc2cab76d88c22917 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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,
});