Skip to content

feat(validation): Improve validation - #9660

Merged
sushantdhiman merged 1 commit into
sequelize:masterfrom
pi-kei:improve-validation
Jul 14, 2018
Merged

sushantdhiman merged 1 commit into
sequelize:masterfrom
pi-kei:improve-validation

Conversation

@pi-kei

@pi-kei pi-kei commented Jul 14, 2018

Copy link
Copy Markdown
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Closes #9648
Adds useful info to validation error that comes from type validators when typeValidation option is on. ValidationError will contain one ValidationErrorItem with the following properties:

  • path: name of the field
  • value: value of the field
  • instance: always null
  • validatorKey: string formatted as <TYPE> validator (INTEGER validator)

Add more info to type validation errors
Skip validations for fields with value that is SequelizeMethod

Closes sequelize#9648
@sushantdhiman

Copy link
Copy Markdown
Contributor

Also fixes #9488

@codecov

codecov Bot commented Jul 14, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #9660 into master will increase coverage by <.01%.
The diff coverage is 100%.

@sushantdhiman
sushantdhiman merged commit 735b2a4 into sequelize:master Jul 14, 2018
@pi-kei
pi-kei deleted the improve-validation branch July 14, 2018 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants