Skip to content

Commit 8b6fe83

Browse files
committed
rename spec.rs -> omicron.rs
1 parent f0a39cc commit 8b6fe83

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

dev-tools/openapi-manager/README.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ If in doubt, look at an existing versioned API crate (e.g., `dns-server-api/src/
9292
**For both lockstep and versioned APIs:** once the API crate is defined, update the OpenAPI manager to manage the new OpenAPI document(s). Within this directory:
9393

9494
. In `Cargo.toml`, add a dependency on the API crate.
95-
// XXX-dap-last-step this will need an update
96-
. In `src/spec.rs`, add the crate to the `all_apis` function. (Please keep the list sorted by filename.) For versioned crates, you'll use the `supported_versions()` function defined by the `api_versions!` macro. Again, use one of the existing examples as a guide.
95+
. In `src/omicron.rs`, add the crate to the `all_apis` function. (Please keep the list sorted by filename.) For versioned crates, you'll use the `supported_versions()` function defined by the `api_versions!` macro. Again, use one of the existing examples as a guide.
9796

9897
To ensure everything works well, run `cargo xtask openapi generate`. Your
9998
OpenAPI document should be generated on disk and listed in the output.
@@ -264,8 +263,7 @@ An existing lockstep API can be made versioned. You would do this when transiti
264263
. Run `git rm -f openapi/dns-server.json`.
265264
. Run `mkdir openapi/dns-server`.
266265
. Update the API crate (`dns-server-api/src/lib.rs`) to use the new `api_versions!` macro. See the instructions under <<_adding_new_openapi_documents>> above.
267-
// XXX-dap-last-step
268-
. Update the OpenAPI manager configuration in `src/spec.rs` (in this directory) to specify that the API is now versioned. You'll use the `supported_versions()` function defined by the `api_versions!` macro.
266+
. Update the OpenAPI manager configuration in `src/omicron.rs` (in this directory) to specify that the API is now versioned. You'll use the `supported_versions()` function defined by the `api_versions!` macro.
269267
. Run `cargo xtask openapi generate`. This will generate a new file under `openapi/dns-server` for your initial server version, along with a "latest" symlink.
270268
+
271269
You will probably see this warning:

dev-tools/openapi-manager/src/apis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub struct ManagedApis {
190190
impl ManagedApis {
191191
pub fn all() -> anyhow::Result<ManagedApis> {
192192
ManagedApis::new(
193-
crate::spec::all_apis()
193+
crate::omicron::all_apis()
194194
.into_iter()
195195
.map(ManagedApiConfig::from)
196196
.map(ManagedApi::from)

dev-tools/openapi-manager/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ mod compatibility;
1717
mod environment;
1818
mod git;
1919
mod iter_only;
20+
mod omicron;
2021
mod output;
2122
mod resolved;
22-
mod spec;
2323
mod spec_files_blessed;
2424
mod spec_files_generated;
2525
mod spec_files_generic;
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
// License, v. 2.0. If a copy of the MPL was not distributed with this
33
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5-
// XXX-dap-last-step delete me
6-
7-
use crate::apis::{ApiBoundary, Versions};
8-
use anyhow::Result;
9-
use dropshot::{ApiDescription, ApiDescriptionBuildErrors, StubContext};
10-
use openapi_manager_types::ValidationContext;
11-
use openapiv3::OpenAPI;
5+
use crate::apis::{ApiBoundary, ManagedApiConfig, Versions};
126

137
/// All APIs managed by openapi-manager.
148
// TODO The metadata here overlaps with metadata in api-manifest.toml.

0 commit comments

Comments
 (0)