How to use the swagger-express-ts.SwaggerDefinitionConstant.Model 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 / index.ts View on Github external
info: {
                    title: 'My api',
                    version: '1.0',
                },
                models: {
                    ApiError: {
                        properties: {
                            code: {
                                type:
                                    SwaggerDefinitionConstant.Model.Property
                                        .Type.STRING,
                                example: ['400'],
                            },
                            message: {
                                type:
                                    SwaggerDefinitionConstant.Model.Property
                                        .Type.STRING,
                                example: ['Name of car is required.'],
                            },
                        },
                    },
                },
                responses: {
                    500: {},
                },
                externalDocs: {
                    url: 'My url',
                },
                securityDefinitions: {
                    apiKeyHeader: {
                        type: SwaggerDefinitionConstant.Security.Type.API_KEY,
                        in: SwaggerDefinitionConstant.Security.In.HEADER,
github olivierlsc / swagger-express-ts / src / index.ts View on Github external
express.static('node_modules/swagger-ui-dist')
    );
    app.use(bodyParser.json());
    app.use(
        swagger.express({
            definition: {
                info: {
                    title: 'My api',
                    version: '1.0',
                },
                models: {
                    ApiError: {
                        properties: {
                            code: {
                                type:
                                    SwaggerDefinitionConstant.Model.Property
                                        .Type.STRING,
                                example: ['400'],
                            },
                            message: {
                                type:
                                    SwaggerDefinitionConstant.Model.Property
                                        .Type.STRING,
                                example: ['Name of car is required.'],
                            },
                        },
                    },
                },
                responses: {
                    500: {},
                },
                externalDocs: {
github olivierlsc / swagger-express-ts / src / constructors / constructor.model.ts View on Github external
@ApiModel({
    description: 'Description Constructor.',
    name: 'Constructor',
})
export class ConstructorModel {
    @ApiModelProperty({
        description: 'Id of Constructor',
        required: true,
    })
    public id: string;

    @ApiModelProperty({
        description: 'Name of Constructor',
        required: true,
        itemType: SwaggerDefinitionConstant.Model.Property.Type.STRING,
    })
    public name: string[];
}