decorator-x
Version:
decorator for entity instantiation & validation, auto-generate swagger docs & graphql schema
35 lines (28 loc) • 574 B
JavaScript
// @flow
import { entityProperty } from 'swagger-decorator';
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;
}