support u64
This commit is contained in:
parent
c4c1bc02bc
commit
445b96056e
19
src/main.rs
19
src/main.rs
|
@ -188,13 +188,20 @@ impl ParameterDataExt for openapiv3::ParameterData {
|
||||||
}
|
}
|
||||||
SchemaKind::Type(Type::Integer(it)) => {
|
SchemaKind::Type(Type::Integer(it)) => {
|
||||||
let mut uint;
|
let mut uint;
|
||||||
|
let width;
|
||||||
|
|
||||||
use openapiv3::VariantOrUnknownOrEmpty::Unknown;
|
use openapiv3::VariantOrUnknownOrEmpty::Unknown;
|
||||||
if let Unknown(f) = &it.format {
|
if let Unknown(f) = &it.format {
|
||||||
if f == "uint" {
|
match f.as_str() {
|
||||||
uint = true;
|
"uint" | "uint32" => {
|
||||||
} else {
|
uint = true;
|
||||||
bail!("XXX unknown integer format {}", f);
|
width = 32;
|
||||||
|
}
|
||||||
|
"uint64" => {
|
||||||
|
uint = true;
|
||||||
|
width = 32;
|
||||||
|
}
|
||||||
|
f => bail!("XXX unknown integer format {}", f),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bail!("XXX format {:?}", it.format);
|
bail!("XXX format {:?}", it.format);
|
||||||
|
@ -222,9 +229,9 @@ impl ParameterDataExt for openapiv3::ParameterData {
|
||||||
bail!("XXX enumeration");
|
bail!("XXX enumeration");
|
||||||
}
|
}
|
||||||
if uint {
|
if uint {
|
||||||
"u64".to_string()
|
format!("u{}", width)
|
||||||
} else {
|
} else {
|
||||||
"i64".to_string()
|
format!("i{}", width)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x => bail!("unexpected type {:#?}", x),
|
x => bail!("unexpected type {:#?}", x),
|
||||||
|
|
Loading…
Reference in New Issue