How to use the swagger-express-ts.ApiModel 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 dimeloper / ts-simple-backend / server / models / user.model.ts View on Github external
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',
github olivierlsc / swagger-express-ts / src / constructors / constructor.model.ts View on Github external
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[];
github olivierlsc / swagger-express-ts / src / cars / car.model.ts View on Github external
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;