You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Google has updated the google.rpc.BadRequest.FieldViolation message in its error model by adding two new fields: string reason and LocalizedMessage localized_message. This feature request proposes reflecting this upstream change in the tonic-types crate.
Extend the FieldViolation struct to include two new fields:
pub reason: String
pub localized_message: Option<LocalizedMessage>
Update the following functions to accept two additional parameters (reason: impl Into<String> and loc_message: Option<LocalizedMessage>):
FieldViolation::new
ErrorDetails::with_bad_request_violation
ErrorDetails::add_bad_request_violation
BadRequest::add_violation
This proposal would involve modifying existing functions and therefore introduces a breaking change.
Alternatives
This is an initial proposal, and I would like to open the discussion to consider a non-breaking alternative.
Instead of modifying existing functions, we could add new functions to support the new fields. In that case, I’d appreciate input on appropriate naming conventions.
I’m happy to contribute the implementation once a direction is agreed upon. I already have a branch prepared for the breaking-change version, if you'd like to review it to get a sense of the scope 86d1095
The text was updated successfully, but these errors were encountered:
Feature Request
Crates
tonic-types
Motivation
Google has updated the
google.rpc.BadRequest.FieldViolation
message in its error model by adding two new fields:string reason
andLocalizedMessage localized_message
. This feature request proposes reflecting this upstream change in thetonic-types
crate.Reference:
https://github.com/googleapis/googleapis/blob/a31d216ae702a184b5b00bdece3775177dfb2cf7/google/rpc/error_details.proto#L216-L226
Proposal
Update the
.proto
files to the latest version.Extend the
FieldViolation
struct to include two new fields:pub reason: String
pub localized_message: Option<LocalizedMessage>
Update the following functions to accept two additional parameters (
reason: impl Into<String>
andloc_message: Option<LocalizedMessage>
):FieldViolation::new
ErrorDetails::with_bad_request_violation
ErrorDetails::add_bad_request_violation
BadRequest::add_violation
This proposal would involve modifying existing functions and therefore introduces a breaking change.
Alternatives
This is an initial proposal, and I would like to open the discussion to consider a non-breaking alternative.
Instead of modifying existing functions, we could add new functions to support the new fields. In that case, I’d appreciate input on appropriate naming conventions.
I’m happy to contribute the implementation once a direction is agreed upon. I already have a branch prepared for the breaking-change version, if you'd like to review it to get a sense of the scope 86d1095
The text was updated successfully, but these errors were encountered: