oxidecomputer / oxidecomputer/omicron
Query params that should be required in OpenAPI spec are not
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
image_list_v1 is wrong
image_list_v1 requires a project selector in the query string, which means you need at least a project identifier, but if you use a project ID (as opposed to a name), you don't need the org identifier. So the org is optional but the project is required.
And the struct reflects that: project has type NameOrId, but the org selector is optional.
But in the OpenAPI spec, the project selector does not get required: true like you would expect.
But image_create_v1 is fine
image_create_v1, by contrast, does get the expected params: project is required and org is optional. This endpoint uses the much simpler Query<params::ProjectSelector> so it seems the problem is introduced by having multiple layers of wrappers with #[serde(flatten)] to hide them.
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 in nexus/src/external_api/http_entrypoints.rs and nexus/types/src/external_api/params.rs, then compare image_list_v1 with the working image_create_v1 definition. Inspect the generated entry in openapi/nexus.json and the serde(flatten) wrappers; done means the image_list_v1 project query parameter is required while org remains optional.
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
- Clearly specified
- Newbie friendliness
- 48/100