Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
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: {
@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[];
}