interface Api {
path: string
path: string
method: string
operation: IOpenAPIOperation
schema: IOpenAPI
paramsSchema?: Dict<IOpenAPISchema>
querySchema?: Dict<IOpenAPISchema>
headerSchema?: Dict<IOpenAPISchema>
cookieSchema?: Dict<IOpenAPISchema>
payloadSchema?: Dict<IOpenAPISchema>
constructor (schema: IOpenAPI, path: string, method: ApiMethod, option: IOpenAPIOperation)
validate (data: any, schema: IOpenAPISchema, name: string): boolean
getParams (ctx: Koa.ParameterizedContext, at: IOpenAPIParameterLocation): any
addParamMetaSchema (params: IOpenAPIParameter, schema: IOpenAPISchema | undefined, root: IOpenAPISchema): IOpenAPISchema
async getParamsSchema (at: IOpenAPIParameterLocation): Promise<Dict<IOpenAPISchema>>
async getPayloadSchema (): Promise<Dict<IOpenAPISchema>>
getPayload (ctx: Koa.ParameterizedContext): any
verify (
paramMetaType: string = 'default',
headerMetaType: string = 'default',
cookieMetaType: string = 'default',
queryMetaType: string = 'default'
): Middleware
}
interface Swagger{
apis: Api[]
schema: IOpenAPI
constructor (schema: Omit<IOpenAPI, 'paths'>)
static ui (config: IOpenAPI, json_path?: string, ui_path?: string, web_index_path?: string, web_static_path?: string): Koa.Middleware
print () void
add (path: string, method: ApiMethod, option: IOpenAPIOperation, components?: IOpenAPIComponent): Api
}