Skip to content

Commit 53097af

Browse files
committed
refactor: Add parameter constraints for account_ids in multiple stats files
1 parent f6225cf commit 53097af

12 files changed

+13
-2
lines changed

src/routes/v1/analytics/ability_order_stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub(super) struct AbilityOrderStatsQuery {
6767
#[deprecated]
6868
account_id: Option<u32>,
6969
/// Comma separated list of account ids to include
70+
#[param(inline, min_items = 1, max_items = 1_000)]
7071
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
7172
account_ids: Option<Vec<u32>>,
7273
}

src/routes/v1/analytics/hero_comb_stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pub(crate) struct HeroCombStatsQuery {
8181
#[deprecated]
8282
account_id: Option<u32>,
8383
/// Comma separated list of account ids to include
84+
#[param(inline, min_items = 1, max_items = 1_000)]
8485
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
8586
account_ids: Option<Vec<u32>>,
8687
}

src/routes/v1/analytics/hero_counters_stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pub(super) struct HeroCounterStatsQuery {
7171
#[deprecated]
7272
account_id: Option<u32>,
7373
/// Comma separated list of account ids to include
74+
#[param(inline, min_items = 1, max_items = 1_000)]
7475
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
7576
account_ids: Option<Vec<u32>>,
7677
}

src/routes/v1/analytics/hero_scoreboard.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub(super) struct HeroScoreboardQuery {
6060
#[deprecated]
6161
account_id: Option<u32>,
6262
/// Comma separated list of account ids to include
63+
#[param(inline, min_items = 1, max_items = 1_000)]
6364
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
6465
account_ids: Option<Vec<u32>>,
6566
}

src/routes/v1/analytics/hero_stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub(crate) struct HeroStatsQuery {
9797
#[deprecated]
9898
account_id: Option<u32>,
9999
/// Comma separated list of account ids to include
100+
#[param(inline, min_items = 1, max_items = 1_000)]
100101
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
101102
account_ids: Option<Vec<u32>>,
102103
}

src/routes/v1/analytics/hero_synergies_stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pub(super) struct HeroSynergyStatsQuery {
7171
#[deprecated]
7272
account_id: Option<u32>,
7373
/// Comma separated list of account ids to include
74+
#[param(inline, min_items = 1, max_items = 1_000)]
7475
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
7576
account_ids: Option<Vec<u32>>,
7677
}

src/routes/v1/analytics/item_permutation_stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pub(super) struct ItemPermutationStatsQuery {
6868
#[deprecated]
6969
account_id: Option<u32>,
7070
/// Comma separated list of account ids to include
71+
#[param(inline, min_items = 1, max_items = 1_000)]
7172
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
7273
account_ids: Option<Vec<u32>>,
7374
}

src/routes/v1/analytics/item_stats.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ pub(crate) struct ItemStatsQuery {
148148
#[deprecated]
149149
account_id: Option<u32>,
150150
/// Comma separated list of account ids to include
151+
#[param(inline, min_items = 1, max_items = 1_000)]
151152
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
152153
account_ids: Option<Vec<u32>>,
153154
}

src/routes/v1/analytics/player_scoreboard.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ pub(crate) struct PlayerScoreboardQuery {
7676
#[param(inline, default = "100", maximum = 10000, minimum = 1)]
7777
limit: Option<u32>,
7878
/// Comma separated list of account ids to include
79+
#[param(inline, min_items = 1, max_items = 1_000)]
7980
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
8081
account_ids: Option<Vec<u32>>,
8182
}

src/routes/v1/analytics/player_stats_metrics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub(crate) struct PlayerStatsMetricsQuery {
6060
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
6161
exclude_item_ids: Option<Vec<u32>>,
6262
/// Comma separated list of account ids to include
63+
#[param(inline, min_items = 1, max_items = 1_000)]
6364
#[serde(default, deserialize_with = "comma_separated_deserialize_option")]
6465
account_ids: Option<Vec<u32>>,
6566
}

0 commit comments

Comments
 (0)