-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
apiRelated to the API.Related to the API.
Description
For example, see:
omicron/oximeter/oximeter/src/histogram.rs
Lines 71 to 87 in 17485e8
| /// 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:
omicron/openapi/nexus-internal.json
Line 447 in 17485e8
| "BinRangedouble": { |
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.
Metadata
Metadata
Assignees
Labels
apiRelated to the API.Related to the API.