Skip to content
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

Question - Bail mode #87

Open
kimchi-lover opened this issue Dec 11, 2024 · 1 comment
Open

Question - Bail mode #87

kimchi-lover opened this issue Dec 11, 2024 · 1 comment
Assignees
Labels
Type: Bug The issue has indentified a bug

Comments

@kimchi-lover
Copy link

Hello. It looks like bail(false) doesn't work properly (or maybe I didn't get a point what it actually does).
For example, let's look at this code:

import vine from '@vinejs/vine'

const schema = vine.object({
  email: vine.string().email().minLength(5).bail(false)
})

const data = {
  email: 'virk',
}

const validator = vine.compile(schema)
const output = await validator.validate(data)

console.log(output)

Here I expect to get both errors(incorrect email and about length), but I have got only first one(about email).
Is this a bug or I just don't understand how it's working?

@kimchi-lover kimchi-lover changed the title Question - <Bail mode> Question - Bail mode Dec 11, 2024
@thetutlage
Copy link
Contributor

Indeed. That looks like an issue with the rules implementation. It should not check for the field validity internally and rely on the compiler + bail mode to skip invalid fields.

I will handle it 👍

@thetutlage thetutlage self-assigned this Dec 23, 2024
@thetutlage thetutlage added the Type: Bug The issue has indentified a bug label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue has indentified a bug
Projects
None yet
Development

No branches or pull requests

2 participants