Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Schema } from 'mongoose';
import { ApiModel, ApiModelProperty } from 'swagger-express-ts';
import mongoose from '../config/database';
export interface IUser {
_id?: string;
email: string;
password: string;
}
@ApiModel({
description: 'User Model',
name: 'User'
})
export class UserModel implements IUser {
/* tslint:disable */
public _id?: string;
/* tslint:enable */
@ApiModelProperty({
description: 'email of user',
example: ['email@test.com'],
required: true,
})
public email: string;
@ApiModelProperty({
description: 'password of user',
import {
ApiModel,
ApiModelProperty,
SwaggerDefinitionConstant,
} from 'swagger-express-ts';
@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[];
import { ApiModel, ApiModelProperty } from 'swagger-express-ts';
import { ConstructorModel } from '../constructors/constructor.model';
@ApiModel({
description: 'Car description',
name: 'Car',
})
export class CarModel {
@ApiModelProperty({
description: 'Id of car',
required: true,
example: ['123456789', '12345'],
})
public id: string;
@ApiModelProperty({
description: '',
required: true,
})
public name: string;