Skip to content

Commit 55ff4ba

Browse files
committed
update README
1 parent 5cc176f commit 55ff4ba

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

crates/dropshot-api-manager/README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ For more information about API traits, see [Oxide RFD 479](https://rfd.shared.ox
99
>
1010
> * [Enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development#activate-developer-mode), which allows non-administrators to create symlinks.
1111
> * Run `git config --global core.symlinks true`.
12-
> * Disable CRLF conversions within Git by checking in a `.gitattributes` file with:
12+
>
13+
> Also, disable CRLF conversions within Git by checking in a `.gitattributes` file with:
1314
>
1415
> ```
1516
> # Disable CRLF conversions on Windows.
@@ -238,7 +239,20 @@ For much more on this, see [RFD 532 "Versioning for internal HTTP APIs"](https:/
238239

239240
For a versioned API, the set of all supported versions is defined by the `api_versions!` macro in the API crate. More precisely: in configuring the OpenAPI manager tool to know about a versioned API, you use the `supported_versions()` function defined by the macro. **This is critical: the OpenAPI documents in the `openapi` directory are _not_ the source of truth about what versions are supported. The Rust `api_versions!` call is.**
240241

241-
Each of these supported versions is either **blessed** (meaning it's been committed-to -- i.e., shipped, or potentially deployed on a system that we care about upgrading smoothly) or **locally-added**. Currently, blessed versions are not allowed to change _at all_. In the near future, we hope to relax this a bit so that they can be changed in ways that are provably compatible (e.g., doc changes).
242+
Each of these supported versions is either **blessed** (meaning it's been committed-to -- i.e., shipped, or potentially deployed on a system that we care about upgrading smoothly) or **locally-added**. Blessed versions are only allowed to change in provably wire-compatible ways.
243+
244+
Changes **allowed** in blessed versions include:
245+
246+
* Documentation updates
247+
* Renaming types while keeping the overall structure the same
248+
* Adding or removing newtype wrappers
249+
250+
Changes **not allowed** in blessed versions include:
251+
252+
* Adding or removing endpoints
253+
* Adding or removing fields from a struct
254+
* Adding or removing variants from an enum
255+
* Changing string validation regexes
242256

243257
When you run `cargo openapi check` or `cargo openapi generate`, the tool loads OpenAPI documents from three sources:
244258

@@ -248,7 +262,7 @@ When you run `cargo openapi check` or `cargo openapi generate`, the tool loads O
248262

249263
Putting all this together, the tool is pretty straightforward. For each supported version of a versioned API:
250264

251-
* If there is a blessed file for that version, then the version is blessed. The generated file must exactly match the blessed one. If not, the tool cannot fix this. You have to undo whatever changes you made that affected the blessed version. (See above on how to make changes to the API trait without affecting older versions.)
265+
* If there is a blessed file for that version, then the version is blessed. The generated file must match the blessed one (up to wire-compatibility). If they don't, the tool cannot fix this. You have to undo whatever changes you made that affected the blessed version. (See above on how to make changes to the API trait without affecting older versions.)
252266
* If there is no blessed file for that version, then the version is locally-added. There should be exactly one local file for it and it should exactly match the generated file. The tool can fix any problems here by removing all local files and generating a new one based on the generated one.
253267
* The tool also ensures that a "latest" symlink exists and points to the highest-numbered OpenAPI document.
254268

0 commit comments

Comments
 (0)