Skip to content

fix: allow multiple regex validators on one field - #399

Open
rome-xi wants to merge 1 commit into
Keats:masterfrom
rome-xi:contrib/validator-344
Open

fix: allow multiple regex validators on one field#399
rome-xi wants to merge 1 commit into
Keats:masterfrom
rome-xi:contrib/validator-344

Conversation

@rome-xi

@rome-xi rome-xi commented Aug 24, 2026

Copy link
Copy Markdown

Closes #344.

After the darling-based rewrite, regex was modeled as a single Option, so #[validate(regex(...), regex(...))] failed with Duplicate field \regex``. That used to work in 0.16 and the maintainer asked for a PR to restore it.

Mirror custom: parse regex with #[darling(multiple)] into a Vec and emit one check per entry. Adds regression tests for multi-regex success, single failure, and both failing.

Signed-off-by: rome-xi <rome-xi@users.noreply.github.com>
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.

error: Duplicate field regex

1 participant