oxidecomputer / oxidecomputer/omicron
openapi generate is no-oping.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
I have a change in a data structure that is visible externally, so nexus.json needs to be updated. cargo xtask openapi generate recognizes that this needs to happen and tells me that it will update the file accordingly, but the file is left untouched:
nils@atrium:~/dev/omicron$ cargo xtask openapi generate
[...]
problem: For this lockstep API, OpenAPI document generated from the current code does not match the local file: "nexus.json". This tool can update the local file for you.
fix: will rewrite lockstep file nexus.json from generated
--- /home/nils/dev/omicron/openapi/nexus.json
+++ /home/nils/dev/omicron/openapi/nexus.json
[...]
nils@atrium:~/dev/omicron$ git diff
nils@atrium:~/dev/omicron$
I am based against main commit 6c84e60cb360c87e3eb294155f2e6d898446130a
The diffs that cause the API change are:
nils@atrium:~/dev/omicron$ git diff main common/
diff --git a/common/Cargo.toml b/common/Cargo.toml
index 0ed300f0b..4b0e71db6 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -26,6 +26,7 @@ futures.workspace = true
hex.workspace = true
http.workspace = true
ipnetwork.workspace = true
+lldp = { git = "https://github.com/oxidecomputer/lldp", package = "protocol" }
macaddr.workspace = true
mg-admin-client.workspace = true
omicron-uuid-kinds.workspace = true
diff --git a/common/src/api/external/mod.rs b/common/src/api/external/mod.rs
index 02b1f985d..b725ed7ed 100644
--- a/common/src/api/external/mod.rs
+++ b/common/src/api/external/mod.rs
@@ -2717,7 +2717,7 @@ pub struct LldpNeighbor {
pub system_description: Option<String>,
/// The LLDP management IP(s) advertised by the neighbor
- pub management_ip: Vec<oxnet::IpNet>,
+ pub management_ip: Vec<lldp::types::ManagementAddress>,
}
impl SimpleIdentity for LldpNeighbor {
nils@atrium:~/dev/omicron$
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the cargo xtask openapi generate entry point and inspect how it handles the reported lockstep mismatch for openapi/nexus.json. Reproduce the command using the LLDP-related change in common/src/api/external/mod.rs, then verify that generation writes the file and that git diff shows the expected API update.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, rust
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100