We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A custom decorator breaks the generation of the spec
export function IsResourceExist(resourceManager: any, key?: string) { return function resourceExist(object: Object, propertyName: string) { registerDecorator({ name: 'IsResourceExist', target: object.constructor, propertyName, validator: { async validate(value: any): Promise<boolean> { let exist = true; if (value) { let manager: find = Container.get(resourceManager); await manager.find(new Pagination({ [key || 'id']: value })); } return exist; }, } }); }; } class Example { @IsNumber({}, { each: true }) @IsArray() @JSONSchema({ description: 'Payment gateways ID', example: [1, 2], }) @IsResourceExist(PaymentGatewayManager) payment_gateways: number[] }
this returns in the yaml
Example : properties: payment_gateways: $ref: '#/components/schemas/Array' items: type: number type: array description: Payment gateways ID example: - 1 - 2
If i remove the custom decorator, the documentation is generated as spected
Example : properties: payment_gateways: items: type: number type: array description: Payment gateways ID example: - 1 - 2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
A custom decorator breaks the generation of the spec
this returns in the yaml
If i remove the custom decorator, the documentation is generated as spected
The text was updated successfully, but these errors were encountered: