windmill_api/
lib.rs

1#![allow(unused_imports)]
2#![allow(clippy::too_many_arguments)]
3
4extern crate serde_repr;
5extern crate serde;
6extern crate serde_json;
7extern crate url;
8extern crate reqwest;
9
10pub mod apis;
11pub mod models;
12  
13// NOTE: Injected by rust-client/dev.nu
14pub fn from_str_patched<'a, T>(s: &'a str) -> Result<T, serde_json::Error>
15where
16    T: serde::de::DeserializeOwned + 'static,
17{
18    if std::any::TypeId::of::<T>() == std::any::TypeId::of::<String>()
19        || std::any::TypeId::of::<T>() == std::any::TypeId::of::<uuid::Uuid>() {
20        // unsafe { std::mem::transmute::<&str, T>(s) }
21        // Quote string
22        let a = format!("\"{}\"", s.replace('"', r#"\""#));
23        serde_json::from_str(&a)
24    } else {
25        serde_json::from_str(s)
26    }
27}
28