-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
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
Feat: Make a validation in body of request (DTO) #49
Feat: Make a validation in body of request (DTO) #49
Conversation
validation in Decorator code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice PR overall as it adds a lot of value. A few details need to change but overall it's nice ! Thank you !
The only thing missing is a way to de-activate body validation. But it can be another PR !
Documentation can be in another PR if you want, once we are done with this one !
…ted 'isArray' function
with HttpException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## main #49 +/- ##
==========================================
+ Coverage 84.60% 85.10% +0.50%
==========================================
Files 26 38 +12
Lines 1104 1182 +78
Branches 90 98 +8
==========================================
+ Hits 934 1006 +72
- Misses 168 174 +6
Partials 2 2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Issue Ticket Number
Closes Issue #12 .
Description
Now, it's possible make a DTO to assign for parameters that implement @Body() in Controllers methods.
The DTO needs to be a class, which each field uses Validation decorator of the repository Savory/validatte
Example
I wrote some tests to this feature too, but didn't do the documentation yet. I let it for another Issue, but I can write in this one if you guys prefer.
It was also my first time with Deno and handle decorators internally. I'm open to listening to any note, suggestion or something wrong =D
Type of change
Checklist:
deno lint
ANDdeno fmt
ANDdeno task test
and got no errors.