Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nestjs/swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Aug 20, 2020
2 parents 1f5be6b + e224875 commit 5de276c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/decorators/api-response.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { omit } from 'lodash';
import { DECORATORS } from '../constants';
import {
ResponseObject,
SchemaObject
SchemaObject,
ReferenceObject
} from '../interfaces/open-api-spec.interface';
import { getTypeIsArrayTuple } from './helpers';

Expand All @@ -18,7 +19,7 @@ export interface ApiResponseMetadata

export interface ApiResponseSchemaHost
extends Omit<ResponseObject, 'description'> {
schema: SchemaObject;
schema: SchemaObject & Partial<ReferenceObject>;
status?: number;
description?: string;
}
Expand Down Expand Up @@ -180,6 +181,14 @@ export const ApiNotImplementedResponse = (options: ApiResponseOptions = {}) =>
status: HttpStatus.NOT_IMPLEMENTED
});

export const ApiPreconditionFailedResponse = (
options: ApiResponseOptions = {}
) =>
ApiResponse({
...options,
status: HttpStatus.PRECONDITION_FAILED
});

export const ApiPayloadTooLargeResponse = (options: ApiResponseOptions = {}) =>
ApiResponse({
...options,
Expand Down

0 comments on commit 5de276c

Please sign in to comment.