Skip to content

Commit 0f425c1

Browse files
authored
pass container to class-validator
class-validator needs to use the same container to be able to perform automatic class validation with routing-controllers
1 parent ea30ebc commit 0f425c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/loaders/iocLoader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { MicroframeworkLoader, MicroframeworkSettings } from 'microframework-w3t
22
import { useContainer as routingUseContainer } from 'routing-controllers';
33
import { Container } from 'typedi';
44
import { useContainer as ormUseContainer } from 'typeorm';
5-
5+
import { useContainer as classValidatorUseContainer } from 'class-validator';
66
import { useContainer as graphqlUseContainer } from '../lib/graphql';
77

88
export const iocLoader: MicroframeworkLoader = (settings: MicroframeworkSettings | undefined) => {
@@ -13,5 +13,5 @@ export const iocLoader: MicroframeworkLoader = (settings: MicroframeworkSettings
1313
routingUseContainer(Container);
1414
ormUseContainer(Container);
1515
graphqlUseContainer(Container);
16-
16+
classValidatorUseContainer(Container);
1717
};

0 commit comments

Comments
 (0)