oxidecomputer / oxidecomputer/omicron

Capitalization seems wonky for templatized types in openapi spec

Open
#1,455 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

For example, see:

https://github.com/oxidecomputer/omicron/blob/17485e8bc05a0e50d5223a09094c9b90b677d55c/oximeter/oximeter/src/histogram.rs#L71-L87

In the openapi spec, this becomes:

https://github.com/oxidecomputer/omicron/blob/17485e8bc05a0e50d5223a09094c9b90b677d55c/openapi/nexus-internal.json#L447

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the templatized type and #[schemars(rename = "BinRange{T}")] in oximeter/oximeter/src/histogram.rs, then compare its generated representation at openapi/nexus-internal.json. Read the linked schemars rename documentation to determine how the replacement affects capitalization. Done means the generated OpenAPI name uses the expected PascalCase form, such as BinRangeDouble.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.