oxidecomputer / oxidecomputer/omicron

Use `"format": "uri"` on URI fields in OpenAPI spec

Open
#1,955 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

On string fields in OpenAPI, you can use format values that are not officially defined as part of OpenAPI, with the expectation that tools will either know how to interpret them or ignore them. We already do this for UUIDs and IP addresses:

https://github.com/oxidecomputer/omicron/blob/cdfd6d321de2dfb042032c1beb11fc6693f21b5e/openapi/nexus.json#L19-L31

https://github.com/oxidecomputer/omicron/blob/cdfd6d321de2dfb042032c1beb11fc6693f21b5e/openapi/nexus.json#L9905-L9922

I think it would make sense to put "format": "uri" (or "url"?) on URL fields like this:

https://github.com/oxidecomputer/omicron/blob/cdfd6d321de2dfb042032c1beb11fc6693f21b5e/openapi/nexus.json#L9056-L9075

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 in openapi/nexus.json, especially the URI-related string fields around lines 9056-9075, and compare them with the existing UUID and IP address formats around lines 19-31 and 9905-9922. Determine the appropriate URI format convention and apply it to the relevant URL fields in the OpenAPI spec.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.