For example, see:
|
/// A type storing a range over `T`. |
|
/// |
|
/// This type supports ranges similar to the `RangeTo`, `Range` and `RangeFrom` types in the |
|
/// standard library. Those cover `(..end)`, `(start..end)`, and `(start..)` respectively. |
|
#[derive(Debug, Clone, Copy, PartialEq, Deserialize, Serialize, JsonSchema)] |
|
#[schemars(rename = "BinRange{T}")] |
|
#[serde(tag = "type", rename_all = "snake_case")] |
|
pub enum BinRange<T> { |
|
/// A range unbounded below and exclusively above, `..end`. |
|
RangeTo { end: T }, |
|
|
|
/// A range bounded inclusively below and exclusively above, `start..end`. |
|
Range { start: T, end: T }, |
|
|
|
/// A range bounded inclusively below and unbounded above, `start..`. |
|
RangeFrom { start: T }, |
|
} |
In the openapi spec, this becomes:
Even though it should probably be BinRangeDouble.
It seems like the line:
#[schemars(rename = "BinRange{T}")]
Is the crux of this - AFAICT, this is part of schemars, which documetns that {T} performs a replacement, but it is unclear how to get the right PascalCase capitalization here.
For example, see:
omicron/oximeter/oximeter/src/histogram.rs
Lines 71 to 87 in 17485e8
In the openapi spec, this becomes:
omicron/openapi/nexus-internal.json
Line 447 in 17485e8
Even though it should probably be
BinRangeDouble.It seems like the line:
Is the crux of this - AFAICT, this is part of
schemars, which documetns that {T} performs a replacement, but it is unclear how to get the right PascalCase capitalization here.