Skip to content

Fix incorrect serde(rename) field mapping in ActiveModel::from_json#2855

Open
Huliiiiii wants to merge 2 commits intoSeaQL:masterfrom
Huliiiiii:rename-all
Open

Fix incorrect serde(rename) field mapping in ActiveModel::from_json#2855
Huliiiiii wants to merge 2 commits intoSeaQL:masterfrom
Huliiiiii:rename-all

Conversation

@Huliiiiii
Copy link
Copy Markdown
Member

Closes #2854

@Huliiiiii Huliiiiii requested a review from tyt2y3 December 16, 2025 13:40
@Huliiiiii Huliiiiii changed the title Refactor ActiveModel::from_json Fix incorrect serde(rename) field mapping in ActiveModel::from_json Feb 18, 2026
/// Create ActiveModel from a JSON value
#[cfg(feature = "with-json")]
fn from_json(mut json: serde_json::Value) -> Result<Self, DbErr>
fn from_json(json: serde_json::Value) -> Result<Self, DbErr>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better solution is to implement from_json in the macro, which make code cleaner.

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.

Serde rename_all attribute causes ActiveModelTrait::from_json to no longer default to ActiveValue::NotSet

1 participant