Skip to content

Conversation

@fedeci
Copy link
Member

@fedeci fedeci commented Feb 21, 2024

Description

Fixes #1242

To-do list

  • I have added tests for what I changed.
  • This pull request is ready to merge.

@coveralls
Copy link

coveralls commented Feb 21, 2024

Coverage Status

coverage: 100.0%. remained the same
when pulling 4f59858 on fedeci:fedeci/fix/matched-array-items
into ffd7994 on express-validator:master.

Copy link
Member

@gustavohenke gustavohenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart way of fixing this, but I'd like to discuss a gotcha with this.

A custom validator can validate any aspect of an object/array, which is an undocumented assumption that this PR breaks. It's arguable whether one could still want this behaviour when there's isArray(), isObject(), among others, nowadays.

Should we keep this behaviour?
If yes, we need to mark fields with any user-specified custom validators (which excludes e.g. isArray()/isObject(), implemented using custom()) as being considered known "as a whole", whereas others are "partially" known.

Either way, we need to document it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is checkExact() with wildcards supported?

3 participants