Skip to content

Commit 5de276c

Browse files
committedAug 20, 2020
Merge branch 'master' of https://github.com/nestjs/swagger
2 parents 1f5be6b + e224875 commit 5de276c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed
 

‎lib/decorators/api-response.decorator.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { omit } from 'lodash';
44
import { DECORATORS } from '../constants';
55
import {
66
ResponseObject,
7-
SchemaObject
7+
SchemaObject,
8+
ReferenceObject
89
} from '../interfaces/open-api-spec.interface';
910
import { getTypeIsArrayTuple } from './helpers';
1011

@@ -18,7 +19,7 @@ export interface ApiResponseMetadata
1819

1920
export interface ApiResponseSchemaHost
2021
extends Omit<ResponseObject, 'description'> {
21-
schema: SchemaObject;
22+
schema: SchemaObject & Partial<ReferenceObject>;
2223
status?: number;
2324
description?: string;
2425
}
@@ -180,6 +181,14 @@ export const ApiNotImplementedResponse = (options: ApiResponseOptions = {}) =>
180181
status: HttpStatus.NOT_IMPLEMENTED
181182
});
182183

184+
export const ApiPreconditionFailedResponse = (
185+
options: ApiResponseOptions = {}
186+
) =>
187+
ApiResponse({
188+
...options,
189+
status: HttpStatus.PRECONDITION_FAILED
190+
});
191+
183192
export const ApiPayloadTooLargeResponse = (options: ApiResponseOptions = {}) =>
184193
ApiResponse({
185194
...options,

0 commit comments

Comments
 (0)
Please sign in to comment.