Repository navigation
Lifecycle SAF: align with OAS #5447, adopt externalLinks, define schema #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
miqui
wants to merge
28
commits into
OAI:main
Choose a base branch
from
miqui:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+710
−37
Open
Changes from 14 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
97396a6
Align lifecycle.md with SAF framing using discussion #5 example data
miqui 254cb1c
Merge pull request #2 from miqui/lifecycle-saf-alignment
miqui 2438af1
Update lifecycle.md
miqui cf6e3da
Update endpoint from '/pets' to '/flights'
miqui 4b60bb8
Align lifecycle SAF with OAS #5447 features and add external links ex…
miqui 3bca048
Merge pull request #3 from miqui/lifecycle-saf-features-external-links
miqui d48630f
Fix formatting in lifecycle.md for OpenAPI section
miqui 36a8aef
Replace named lifecycle link fields with an externalLinks array
miqui 5a910ee
Merge pull request #4 from miqui/lifecycle-external-links-array
miqui 75607b7
Define the Lifecycle Object schema and add pass/fail tests
miqui 84487ff
Merge pull request #5 from miqui/lifecycle-schema
miqui a5f5208
Make `deprecated` take precedence over the Lifecycle Object
miqui 07d7d2d
Note that deprecated: true alone is unchanged by the Lifecycle SAF
miqui ef7d652
Merge pull request #6 from miqui/lifecycle-deprecated-precedence
miqui 0c10911
Use uri-reference format for External Documentation Object url
miqui 3f02cb7
Point OAS links at pages that exist until OAS 3.3 is published
miqui 0371a89
Show header output for the complete example and note provisional plac…
miqui bd72f5c
Clarify how the Lifecycle Object relates to deprecated, drop OAS vers…
miqui 6dde9e8
Make a Lifecycle Object without deprecated: true an error
miqui 0b26810
Make lifecycle link relations in response Link headers an error
miqui 25b4c8f
Place the Lifecycle Object under featureFields
miqui 65659c4
Remove the Non-goal paragraph from the Introduction
miqui 2021375
Link to the OAS section on SAF declarations instead of restating it
miqui 44d44a7
Group lifecycle links under named deprecation and sunset fields
miqui 6bd6162
Restrict the Lifecycle Object to operations and drop scope history
miqui db1449c
Fill the compatibility TODO and make Header Mapping advice non-normative
miqui 9292557
Define date-time fields as RFC 3339 date-time values
miqui 5e194b4
Re-run CI after transient link-check failures
miqui File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| date: 1736899200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - date: "2025-01-15T00:00:00Z" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - kind: deprecation | ||
| description: 1 | ||
| url: https://docs.example.com/migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - kind: 1 | ||
| url: https://docs.example.com/migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # kind is REQUIRED in lifecycle.externalLinks | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - url: https://docs.example.com/migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - kind: deprecation | ||
| summary: Migration guide |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - https://docs.example.com/migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - kind: deprecation | ||
| summary: 1 | ||
| url: https://docs.example.com/migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - kind: deprecation | ||
| name: Migration guide | ||
| url: https://docs.example.com/migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - kind: deprecation | ||
| url: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| kind: deprecation | ||
| url: https://docs.example.com/migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| reason: "Replaced by v2 API with improved performance." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| reason: 42 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # migration was replaced by externalLinks with kind: deprecation | ||
| date: "2025-01-15T00:00:00Z" | ||
| migration: | ||
| url: https://docs.example.com/migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # replacement was replaced by externalLinks with kind: successor-version | ||
| date: "2025-01-15T00:00:00Z" | ||
| replacement: | ||
| url: https://api.example.com/v2/openapi.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # sunset.policy was replaced by externalLinks with kind: sunset | ||
| date: "2025-01-15T00:00:00Z" | ||
| sunset: | ||
| date: "2025-07-01T00:00:00Z" | ||
| policy: | ||
| url: https://docs.example.com/sunset-policy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| sunset: | ||
| date: 1751328000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| sunset: {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| sunset: "2025-07-01T00:00:00Z" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Lifecycle Object from the spec's Complete OpenAPI Description Example | ||
| date: "2025-01-15T00:00:00Z" | ||
| reason: "Replaced by v2 API with improved performance." | ||
| sunset: | ||
| date: "2025-07-01T00:00:00Z" | ||
| externalLinks: | ||
| - kind: deprecation | ||
| summary: Migrating from Flights v1 to v2 | ||
| description: | | ||
| Step-by-step guide covering renamed query parameters and the | ||
| new cursor-based pagination. | ||
| url: https://docs.example.com/migrate | ||
| - kind: successor-version | ||
| summary: Flights API v2 | ||
| description: Use `listFlights_v2` (`GET /v2/flights`) instead. | ||
| url: https://api.example.com/v2/openapi.yaml | ||
| - kind: sunset | ||
| summary: API sunset policy | ||
| url: https://docs.example.com/sunset-policy | ||
| - kind: changelog | ||
| summary: Changelog entry announcing the v1 deprecation | ||
| url: https://docs.example.com/changelog#2025-01-15 | ||
| - kind: announcement | ||
| summary: Sunset announcement | ||
| url: https://status.example.com/announcements/flights-v1-sunset |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # External Documentation Objects MAY be extended with Specification Extensions | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - kind: deprecation | ||
| url: https://docs.example.com/migrate | ||
| x-audience: internal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Only the required field | ||
| date: "2025-01-15T00:00:00Z" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # successor-version MAY appear more than once | ||
| date: "2025-01-15T00:00:00Z" | ||
| externalLinks: | ||
| - kind: successor-version | ||
| url: https://api.example.com/v2/openapi.yaml | ||
| - kind: successor-version | ||
| url: https://api.example.com/v3/openapi.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,29 @@ | ||
| import { describe, expect, it } from "@oai/build-infra/test"; | ||
| import { registerSchema } from "@oai/build-infra/schema/vitest"; | ||
| import { readdirSync, readFileSync } from "node:fs"; | ||
| import YAML from "yaml"; | ||
| import { registerSchema, toMatchJsonSchema } from "@oai/build-infra/schema/vitest"; | ||
| import { describe, expect, test } from "@oai/build-infra/test"; | ||
|
|
||
| expect.extend({ toMatchJsonSchema }); | ||
|
|
||
| const schemaUri = "https://spec.openapis.org/lifecycle/1.0/schema/WORK-IN-PROGRESS"; | ||
| await registerSchema("./src/schemas/validation/schema.yaml"); | ||
|
|
||
| // Placeholder test suite - add pass/fail test cases as the schema is developed. | ||
| describe("Lifecycle schema", () => { | ||
| it("validates an empty Lifecycle Object", async () => { | ||
| await expect({}).to.matchJsonSchema("./src/schemas/validation/schema.yaml"); | ||
| }); | ||
| for (const entry of readdirSync("tests/schema/pass", { withFileTypes: true })) { | ||
| if (!entry.isFile() || !entry.name.endsWith(".yaml")) continue; | ||
|
|
||
| test(`pass/${entry.name}`, async () => { | ||
| const document = YAML.parse(readFileSync(`tests/schema/pass/${entry.name}`, "utf8")); | ||
| await expect(document).toMatchJsonSchema(schemaUri); | ||
| }); | ||
| } | ||
|
|
||
| for (const entry of readdirSync("tests/schema/fail", { withFileTypes: true })) { | ||
| if (!entry.isFile() || !entry.name.endsWith(".yaml")) continue; | ||
|
|
||
| test(`fail/${entry.name}`, async () => { | ||
| const document = YAML.parse(readFileSync(`tests/schema/fail/${entry.name}`, "utf8")); | ||
| await expect(document).not.toMatchJsonSchema(schemaUri); | ||
| }); | ||
| } | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.