1 parent 1d298c6 commit b58d84fCopy full SHA for b58d84f
1 file changed
src/api/gi/uigf_wishes_import/mod.rs
@@ -25,6 +25,22 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
25
cfg.service(post_uigf_warps_import);
26
}
27
28
+#[derive(serde::Deserialize)]
29
+#[serde(untagged)]
30
+enum StringOrInt {
31
+ String(String),
32
+ Int(i32),
33
+}
34
+
35
+impl StringOrInt {
36
+ fn parse(self) -> Result<i32, std::num::ParseIntError> {
37
+ match self {
38
+ StringOrInt::String(s) => s.parse(),
39
+ StringOrInt::Int(i) => Ok(i),
40
+ }
41
42
43
44
#[derive(serde::Deserialize, utoipa::ToSchema)]
45
struct UigfWishesImportParams {
46
data: String,
@@ -37,7 +53,7 @@ struct Uigf {
53
54
#[derive(serde::Deserialize)]
55
struct Hk4e {
- uid: String,
56
+ uid: StringOrInt,
57
timezone: i32,
58
list: Vec<Pull>,
59
0 commit comments