From 2f21bc6201597b86632a439f29603b36862415e0 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Sat, 2 Nov 2024 22:21:28 +0100 Subject: [PATCH] added the final round of fixes# --- server/src/locations/details.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/server/src/locations/details.rs b/server/src/locations/details.rs index 6c8ca50f0..9fa481075 100644 --- a/server/src/locations/details.rs +++ b/server/src/locations/details.rs @@ -92,6 +92,14 @@ struct Usage { name: String, } + +#[derive(Deserialize, Serialize, Debug)] +#[serde(untagged)] +enum VecOrItem{ + Array(Vec), + Item(T), +} + #[derive(Deserialize, Serialize, Debug, Default)] struct LocationDetailsResponse { /// The id, that was requested @@ -102,9 +110,9 @@ struct LocationDetailsResponse { type_common_name: String, /// The name of the entry in a human-readable form name: String, - /// TODO: document in openapi - #[serde(skip_serializing_if = "String::is_empty", default = "String::new")] - b_prefix: String, + /// TODO: document in openapi ... AAAAAA WTF??? + #[serde(skip_serializing_if = "Option::is_none")] + b_prefix: Option>, /// TODO: document in openapi #[serde(skip_serializing_if = "String::is_empty", default = "String::new")] arch_name: String, @@ -166,6 +174,9 @@ struct LocationDetailsResponse { /// TODO: document in openapi #[serde(skip_serializing_if = "Option::is_none")] comment: Option, + /// TODO: WHY does this exist??? This is stupid. + #[serde(skip_serializing_if = "Option::is_none")] + generate_rooms_overview:Option, } #[derive(Deserialize, Serialize, Debug, Default)]