Optional
options: Nilable<ICreateSwaggerSchemaForApiResponseOptions>Custom options.
The new schema.
import { Controller, ControllerBase, GET, IHttpRequest, IHttpResponse } from '@egomobile/http-server'
import { createSwaggerSchemaForApiResponse } from '@egomobile/api-utils'
@Controller()
export default class IndexController extends ControllerBase {
@GET({
path: '/',
documentation: {
summary: 'This is a description of that endpoint',
responses: {
'200': {
description: 'Operation was successful.',
content: {
'application/json': {
schema: createSwaggerSchemaForApiResponse({
dataSchema: {
type: 'object',
properties: {
// ...
}
}
})
}
}
}
}
}
})
async index(request: IHttpRequest, response: IHttpResponse) {
// ...
}
}
Generated using TypeDoc
Creates a Swagger schema, which describes a standard API response with custom data schema.