Skip to content

Commit b3d5062

Browse files
refactor(events): update api events to follow snake case naming (#2828)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent f847802 commit b3d5062

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

crates/common_utils/src/events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub trait ApiEventMetric {
88
}
99

1010
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
11-
#[serde(tag = "flow_type")]
11+
#[serde(tag = "flow_type", rename_all = "snake_case")]
1212
pub enum ApiEventsType {
1313
Payout,
1414
Payment {

crates/router/src/events/api_logs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use crate::{
2222
};
2323

2424
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
25+
#[serde(rename_all = "snake_case")]
2526
pub struct ApiEvent {
2627
api_flow: String,
2728
created_at_timestamp: i128,

crates/router/src/services/authentication.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ pub struct AuthenticationData {
2929
}
3030

3131
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
32-
#[serde(tag = "api_auth_type")]
32+
#[serde(
33+
tag = "api_auth_type",
34+
content = "authentication_data",
35+
rename_all = "snake_case"
36+
)]
3337
pub enum AuthenticationType {
3438
ApiKey {
3539
merchant_id: String,

0 commit comments

Comments
 (0)