Commit Graph

49 Commits

Author SHA1 Message Date
Karan Gupta
a0a3fb96cf feat(common): specify parent property for validation of nested objects
Passed the complete path of the parent property as an argument. Earlier, the information regarding the parent was getting lost due to flattening of array in case of validation of nested objects.

Closes #5380
2020-12-05 16:13:45 +05:30
Bernhard Wittmann
4f782b9881 feat(common): await for exception factory in validation pipe
allow the usage of asychronouse code in exception factory

fixes #5718
2020-11-19 17:14:40 +01:00
Kamil Myśliwiec
e8b2761278 refactor(common): move expected type check (validation pipe) to the top 2020-10-30 14:10:29 +01:00
Kamil Myśliwiec
88cf4c1926 Merge branch 'Michael/fix-expectedType-override' of https://github.com/mikicho/nest into mikicho-Michael/fix-expectedType-override 2020-10-30 14:05:53 +01:00
Kamil Mysliwiec
7bf900abe4 Merge pull request #5498 from kkoomen/feature/validation-pipe
feat(validation pipe): use protected methods instead of private
2020-10-29 13:51:07 +01:00
Michael Solomon
dbcc366227 fix(common): expectedType get overriden by metatype 2020-10-25 18:55:59 +02:00
Jay McDoniel
4355bcac0c feat(common): gives validation pipe protected package loads
By having the `loadPackage` for `class-validator` and
`class-transformer` under `protected` methods, other devs can now
decide if they want to use different validation packages, like
`class-validator-multi-lang` but by default will still use the standard
`class-validator` and `class-transformer`.

fix #5542
2020-10-08 22:09:13 -07:00
Kim 金可明
e2a157725c feat(validation pipe): use protected methods instead of private 2020-09-29 10:47:45 +08:00
Kim 金可明
534bb5bc50 feat(validation.pipe): ignore buffer metatypes 2020-09-02 16:28:23 +08:00
Michael Solomon
c1467c5c16 feat(common) add expected type option to validation pipe
It's possible to have multiple pipes for a single parameter, so the argument type won't necessary will be same as the original type and we need to explicitly set the type for the validation pipe
see discussion:
https://discord.com/channels/520622812742811698/520649487924985885/732209853854122055
2020-07-15 22:40:25 +03:00
Kamil Myśliwiec
4ebe4504b9 Merge branch 'master' of https://github.com/nestjs/nest 2020-03-26 17:53:02 +01:00
Kamil Myśliwiec
b039ac9f6d test(common): add test for flattening children errors (validation) 2020-03-26 17:52:39 +01:00
Kamil Mysliwiec
16b593765b Merge branch 'master' into feat/iterate-over-everything 2020-03-26 16:05:43 +01:00
Kamil Myśliwiec
f829f9c25f refactor(): rename to http error status code (validation pipe) 2020-03-26 14:21:04 +01:00
Dominic Preap
3e270a3285 fix(common): update http-error-by-code 2020-03-25 10:21:31 +00:00
Dominic Preap
c2f6b2d413 feat(common): add exception code option in validation pipe 2020-03-24 11:29:39 +00:00
Vadim Goldenko
70b7813915 feat(common): prepend nested validation errors with parent prop 2020-03-20 16:41:55 +03:00
Vadim Goldenko
41381dcd42 feat(common): add nested validation errors parse 2020-03-20 15:58:36 +03:00
cojack
08559a1bbc feat(common): use iterate to reduce number of loops 2020-03-17 10:56:51 +01:00
Kamil Myśliwiec
a5271dde02 fix(common): revert implicit type conversion (validation pipe) 2020-03-17 09:31:41 +01:00
Kamil Myśliwiec
904abb630a feat(common): map validation errors to strings 2020-03-03 11:43:31 +01:00
Kamil Mysliwiec
57ff808e36 Revert "feat(common): transform primitives (number, bool) with validation pipe" 2020-02-20 14:34:24 +01:00
Kamil Myśliwiec
4d97ba63ee feat(common): transform primitives (number, bool) with validation pipe 2020-02-19 14:57:54 +01:00
Kamil Myśliwiec
233bc860e7 fix(common): revert back to nil value when acceptable 2020-01-28 09:21:07 +01:00
Kamil Myśliwiec
904e0d1794 fix(common) transformer pipes fix (when validation pipe is used) 2019-10-04 08:50:10 +02:00
Kamil Myśliwiec
d4bb43009b fix(common) add additional security check to validation pipe 2019-09-03 15:14:10 +02:00
Nils Bergmann
971d92e7fd feature(common): add option to allow validation of custom decorators
No matter what the reason is to not validate custom decorators, you should be able to at least provide an option
2019-05-30 13:38:14 +02:00
Kamil Myśliwiec
e2f93ef226 refactor(): move condition to filter function 2019-05-21 23:03:46 +02:00
Sebastian Walter
4b73ca638e bugfix(common) Stripping proto properties works with null values
If an optional property has an allowed null value it is now considered when stripping proto props.
2019-05-20 16:32:21 +02:00
Kamil Myśliwiec
b3f51cc9c1 hotfix(): fix validation pipe (strip proto properties) 2019-05-20 10:41:56 +02:00
Kamil Myśliwiec
404afdca93 merge(): resolve conflicts 2019-02-21 09:06:25 +01:00
Kamil Myśliwiec
e4179eb380 enhancement() add loader function to load package utility 2019-01-30 23:07:34 +01:00
Fiona Lovett
69f2f3dd0b feature(common): add transformOptions to ValidationPipeOptions
allows plainToClass to expose class properties to defined groups as per issue #1374
2019-01-02 19:56:33 +01:00
Kamil Myśliwiec
4796023e02 chore() resolve conflicts 2018-12-10 22:03:06 +01:00
Kamil Myśliwiec
ee9d31671c feature(common) add validation error factory (ValidationPipe) 2018-12-06 18:33:22 +01:00
Kamil Myśliwiec
1cac0a99fd feature: more typings, refactor 2018-11-28 23:08:27 +01:00
Kamil Myśliwiec
1cb3ed7f87 refactor: general refactor reorganize, rename things 2018-11-24 16:01:29 +01:00
Jean-Baptiste Pionnier
558e33f25c refactor: enable strict mode 2018-09-20 11:24:39 +02:00
Jean-Baptiste Pionnier
b296cabd35 refactor: resolve module path 2018-09-03 21:34:15 +02:00
Kamil Myśliwiec
09c9f704e5 Merge pull request #909 from nestjs/5.2.0
chore(@nestjs) publish 5.2.0 minor release
2018-08-22 15:47:53 +02:00
Jean-Baptiste Pionnier
2bdf47a572 refactor: use some method 2018-08-09 08:27:39 +02:00
Kamil Myśliwiec
96da5bd9c5 feature(@nestjs/core) add @Optional() decorator #847 2018-08-01 22:31:39 +02:00
Kamil Myśliwiec
f4817ee4eb feature(@nestjs/common) add error messages disabled mode (ValidationPipe) 2018-06-21 23:00:33 +02:00
Kamil
3888d8ee8b bugfix(@nestjs/common) ValidationPipe throws 500 error 2018-06-20 17:34:00 +02:00
Kamil Myśliwiec
7b950ffa6e feature(@nestjs/common) make ValidationPipe properties protected 2018-05-09 17:19:38 +02:00
Kamil Myśliwiec
181d8c6585 feature(@nestjs/common) add package loader utility 2018-04-30 13:01:37 +02:00
Kamil Myśliwiec
3160245145 refactor(@nestjs) fix tslint issues, format code 2018-04-21 14:22:24 +02:00
Kamil Myśliwiec
5f735b11c9 bugfix: deprecate missing @Pipe() decorator, fix HttpModule 2018-04-18 12:29:39 +02:00
Kamil Myśliwiec
614de27310 refactor(@nestjs) rename directories, add script, fix tests 2018-03-24 15:11:48 +01:00