How to use the swagger-express-ts.SwaggerDefinitionConstant.Parameter function in swagger-express-ts

To help you get started, we’ve selected a few swagger-express-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github olivierlsc / swagger-express-ts / src / version / version.controller.ts View on Github external
@injectable()
export class VersionController implements interfaces.Controller {
    public static TARGET_NAME: string = 'VersionController';

    constructor(
        @inject(VersionsService.TARGET_NAME)
        private versionsService: VersionsService
    ) {}

    @ApiOperationGet({
        description: 'Get version object',
        parameters: {
            path: {
                id: {
                    required: true,
                    type: SwaggerDefinitionConstant.Parameter.Type.STRING,
                },
            },
        },
        responses: {
            200: {
                model: 'Version',
            },
            400: {},
        },
    })
    @httpGet('/')
    public getVersion(
        @requestParam('id') id: string,
        request: express.Request,
        response: express.Response,
        next: express.NextFunction