Skip to content

openapi linting#1024

Merged
ahl merged 13 commits into
mainfrom
lin
May 17, 2022
Merged

openapi linting#1024
ahl merged 13 commits into
mainfrom
lin

Conversation

@ahl

@ahl ahl commented May 6, 2022

Copy link
Copy Markdown
Contributor

This is still a WIP, but only insofar as it depends on some in-flight changes for openapi-lint, progenitor, and typify.

This makes omicron conform to the updated openapi-lint per oxidecomputer/openapi-lint#7

Most significantly:

  • enums all include #[serde(rename_all = "snake_case")] (unless they're all caps such as with DnsRecord)
  • IpNet effectively becomes a string with various formatting constraints
  • I've simplified a bunch of copy-pasta with ..Default::default()
  • Some small changes to oximeter types for consistency
  • Bifurcation of oximeter types between persistent structures and API interfaces

@ahl ahl requested review from bnaecker and david-crespo May 10, 2022 23:18
Comment thread oximeter/oximeter/src/types.rs Outdated

@bnaecker bnaecker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks totally cool to me. Thanks for your attention to detail here, I think it'll be a big polish improvement!

Comment thread openapi/sled-agent.json
"V6"
],
"additionalProperties": false
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the upshot of the allOf change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is explained... some? .. in the code here:

https://github.com/oxidecomputer/omicron/pull/1024/files/9cdf6945c4e385a2ad62ca0319d2378bac6fbeea#diff-702b757e89b01c09790358016361ef6bd659081d6b4419810510f0b859366d11R1206-R1209

progenitor (via typify) will see this title field and use this as the label for an enum. So it will construct the type so that it matches the original IpNet.

I've opened an issue with schemars to have this in untagged schemas (which would do this automatically for us here): GREsau/schemars#102

@ahl ahl marked this pull request as ready for review May 17, 2022 05:15
@ahl ahl merged commit 60a45b6 into main May 17, 2022
@ahl ahl deleted the lin branch May 17, 2022 17:01
davepacheco added a commit that referenced this pull request May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants