Renamed property name is no longer used in the error report (0.17.0)
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Keats/validator
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 18/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 55/100
Similar issues
-
A-git C-bug S-needs-info
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
rust-lang/cargo#17794 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
LadybirdBrowser/ladybird#15821 ·
Maintainers usually reply within 1 day
-
`SortMergeJoinExec` panics instead of returning an error when its output coalescer rejects a batchOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
apache/datafusion#27728 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
limitlessprojects/Go-Hybrid#4764 ·
Maintainers usually reply within 1 day
-
enhancement good first issue ready
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MartinPTielemans/ilo#4238 ·
Maintainers usually reply within 1 day