Docs improvements (#6615)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-02 03:56:27 +12:00
committed by GitHub
parent 00148d84d8
commit 16f5d9c284
285 changed files with 1853 additions and 4168 deletions

View File

@ -792,15 +792,21 @@ fn rust_type_to_openapi_type(t: &str) -> String {
if t.starts_with("Option<") {
t = t.replace("Option<", "").replace('>', "");
}
if t == "[TyF64;2]" {
return "Point2d".to_owned();
}
if t == "[TyF64;3]" {
return "Point3d".to_owned();
}
if let Some((inner_type, _length)) = parse_array_type(&t) {
t = format!("[{inner_type}]")
}
if t == "f64" || t == "TyF64" {
if t == "f64" || t == "TyF64" || t == "u32" || t == "NonZeroU32" {
return "number".to_string();
} else if t == "u32" {
return "integer".to_string();
} else if t == "str" {
} else if t == "str" || t == "String" {
return "string".to_string();
} else {
return t.replace("f64", "number").replace("TyF64", "number").to_string();