Skip to content

Conversation

@MathieuTricoire
Copy link

@MathieuTricoire MathieuTricoire commented Dec 5, 2025

Motivation

fix #2460

Fields reason and localized_message from BadRequest::FieldViolation are not serialized into the underlying protobuf message and therefore never make it onto the wire.

Solution

Fix the conversion from FieldViolation to the prost-generated pb::bad_request::FieldViolation by explicitly forwarding both the reason and localized_message fields instead of leaving them at their default values.

A new test is added to ensure that behavior.

}

#[test]
fn gen_bad_request_with_verbose_field_violation() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd recommend either merging the business logic into the original test or creating an incremental fine grained test that tests just the new business logic that has been added in this change.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @sauravzg for the review! I've merged the new coverage into the original test as suggested. Let me know if this looks good to you.

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.

2 participants