swagger-decorator
Version:
Decorator for Koa2 and koa-router, Auto-Generate Swagger Docs
34 lines (28 loc) • 573 B
JavaScript
import { entityProperty } from "swagger-decorator";
// @flow
import AnotherEntity from "./AnotherEntity";
class Entity {
// Comment
@entityProperty({
type: "string",
required: false,
description: "Comment"
})
stringProperty: string = 0;
@entityProperty({
type: Entity,
required: false
})
classProperty: Entity = null;
@entityProperty({
type: "string",
required: false
})
rawProperty;
@entityProperty({
type: "string",
description: "this is property description",
required: true
})
decoratedProperty;
}