Trading card city builder game?

fixing AccountIdOrMe type

eldridge.cam a8cd5021 f781e71e

verified
+8 -2
+1
src/api/operations/list_fields.rs
··· 25 25 db: axum::Extension<sqlx::PgPool>, 26 26 Path(player_id): Path<AccountIdOrMe>, 27 27 ) -> axum::response::Result<Json<ListFieldsResponse>> { 28 + dbg!(&player_id); 28 29 let AccountIdOrMe::AccountId(account_id) = player_id else { 29 30 respond_internal_server_error!("unimplemented"); 30 31 };
+2 -2
src/dto/mod.rs
··· 3 3 use time::OffsetDateTime; 4 4 use utoipa::ToSchema; 5 5 6 - #[derive(Serialize, Deserialize, ToSchema)] 7 - #[serde(untagged)] 6 + #[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize, ToSchema)] 8 7 pub enum AccountIdOrMe { 9 8 #[serde(rename = "@me")] 10 9 Me, 10 + #[serde(untagged)] 11 11 AccountId(String), 12 12 } 13 13
+5
src/main.rs
··· 20 20 21 21 api::operations::list_fields, 22 22 ), 23 + components( 24 + schemas( 25 + crate::dto::AccountIdOrMe 26 + ) 27 + ), 23 28 tags( 24 29 (name = "Global", description = "Publicly available global data about the Cartography game."), 25 30 (name = "Player", description = "Player specific data; typically requires authorization."),