-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
deps: [email protected] #6645
deps: [email protected] #6645
Conversation
validator 5.0.0 breaks validation of non-string input values. this has some interesting consequences:
Moreover, validator dropped |
"nodemailer", | ||
"pg", | ||
"showdown-ghost", | ||
"validator" |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This is looking good thanks 👍 Having the boolean validations be automatic rather than explicit seems sensible. Did you do much testing to see if there were cases where the assertion/deprecation message gets spat out? |
Well, it wouldn't create warnings anymore, since |
@joerx would be excellent if you could check for any code paths using validator directly (hope not!) and run a couple of tests - perhaps try sending weird values to the API? Other than that this looks good to go :) |
OK, so I did some searching and I actually found quite a few direct uses of 'validate' in the code:
Manually testing Posts/Settings APIs produced 500s - ironically not related to the validator at all, but caused by Another thing I noticed: |
I'm still wondering what's the best option to avoid |
This looks like it's probably catching and fixing some gnarly edge cases!
Yes, it's always good to remove dead code, even if it might be brought back later.
Reading this stackoverflow on the subject, highlights why |
Any reason why |
I left a note on this PR as to why I didn't upgrade it, but I can't say that I remember what the note means 😞 |
42c4af7
to
6b95465
Compare
Ok, I think this is ready to merge, with one tiny exception - can you please remove the caret from the new dependency version in |
Done |
@joerx This is all looking good, unfortunately all GitHub notifications started going into my spam folder over the weekend and so I didn't see this before it got a merge conflict 😞 If you have time to rebase that'd be great otherwise I'll look at doing it myself sometime later this week. |
closes TryGhost#6462 - monkey-patch validator.extends() since it was dropped by validator @5.0.0 - coerce input to string prior to validation (custom toString func) - need to handle boolean validation based on column type not isIn() - use `lodash.tostring` to convert input values to strings
Got some code for us? Awesome 🎊!
Please include a description of your change & check your PR against this list, thanks!
npm test
).More info can be found by clicking the "guidelines for contributing" link above.
closes #6462