Skip to content

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

Description

@iensu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions