express-openapi: Allow reference in schema property of response object

This commit is contained in:
MugeSo
2016-02-17 10:14:29 +09:00
parent 01d18f8a91
commit 0d0f6fe1e3
2 changed files with 8 additions and 2 deletions

View File

@@ -40,6 +40,10 @@ get.apiDoc = {
}
],
responses: {
200: {
description: "valid user object",
schema: {$ref: '#/definitions/user'}
},
default: {$ref: '#/definitions/error'}
},
"x-some-vendor-property": {}

View File

@@ -128,7 +128,7 @@ declare module "express-openapi" {
export interface ResponseObject {
description: string
schema?: SchemaObject
schema?: Schema
headers?: HeadersObject
examples?: ExampleObject
}
@@ -209,7 +209,7 @@ declare module "express-openapi" {
}
export interface InBodyParameterObject extends ParameterObject {
schema: SchemaObject
schema: Schema
}
export interface GeneralParameterObject extends ParameterObject, ItemsObject {
@@ -226,6 +226,8 @@ declare module "express-openapi" {
url: string
}
type Schema = SchemaObject | ReferenceObject
export interface SchemaObject extends IJsonSchema {
[index: string]: any
discriminator?: string