Renamed property name is no longer used in the error report (0.17.0)

Open
#306 9 comments 0 reactions 0 assignees View on GitHub

@DarkCat09 is already working on this.

Since Jan 28, 2026.

  • #388 by @DarkCat09 — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
backend

Research direction

Start by reproducing the issue with the User example and compare the validation error report in versions 0.16.1 and 0.17.0. Inspect the validation error reporting path and its interaction with serde rename metadata, then add a regression test showing that the reported field is firstName rather than first_name.

Written by the indexing model from the issue text.

Description

In 0.16.1 the validation error report uses the renamed property name when using #[serde(rename = "...")], but in 0.17.0 the original property name is used.

#[derive(Debug, serde::Deserialize, validator::Validate)]
pub struct User {
    #[validate(length(min = 1, message = "too short"))]
    #[serde(rename = "firstName")]
    pub first_name: Option<String>,
}

In 0.16.1 the error report says firstName: too short, but in 0.17.0 it's first_name: too short. This is problematic since the firstName is what is actually expected to be sent from the client, not first_name.

Dominant language
Rust
Stars
2.5k
Forks
190
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Keats/validator

All issues in Keats/validator

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.