What does HackerNews think of class-validator?
Decorator-based property validation for classes.
Language:
TypeScript
#54
in
TypeScript
We add validation using https://github.com/typestack/class-validator.
I will make sure we get this documented.
I use a combination of class-transformer[1] and then class-validator[2].
First transform the JSON into proper class-objects and then validate the object for correctnes.
IMHO this has nothing to do with TypeScript because in your runtime all the type information is gone and you need to validate the remote data never the less. TypeScript can help you structure your validations but you need to write them.
There is also class-validator, which I've used and I find elegant and working well:
There is also class-transformer[1] and class-validator[2] which also do the same job but integrate a bit better into the whole typescript cosmos.
[1] https://github.com/typestack/class-transformer [2] https://github.com/typestack/class-validator