Skip to content

Lifecycle SAF: align with OAS #5447, adopt externalLinks, define schema - #16

Open
miqui wants to merge 16 commits into
OAI:mainfrom
miqui:main
Open

miqui wants to merge 16 commits into
OAI:mainfrom
miqui:main

Conversation

@miqui

@miqui miqui commented Oct 29, 2026 •

Copy link
Copy Markdown

Summary

This PR brings the Lifecycle Specification in line with the SAF mechanism merged in OAI/OpenAPI-Specification#5447. It builds the Lifecycle Object on the Docs Links proposal, and replaces the stub schema with a real one. It supersedes #15.

SAF framing (operation-scoped, per discussion #5)

  • The Lifecycle Object describes one operation's deprecation and sunset. It is not a document-wide object; applying it across many operations is left to Overlays.
  • Adds a mapping from Lifecycle Object fields to the Deprecation (RFC 9745), Sunset (RFC 8594), and Link headers, and an informative appendix on AI agent / MCP use.

Alignment with OAS #5447

  • A document opts in through the root features map (features: { security: 1.0.0, lifecycle: 1.0.0 }). The spec notes that security must be listed explicitly once features is set.
  • The Lifecycle Object lives in a dedicated Operation Object lifecycle field, not in an operation-level features. This avoids reusing the root features name with a different type.

Adopting externalLinks (Docs Links proposal)

  • Breaking, pre-1.0.0: migration, replacement, and sunset.policy are replaced by a single lifecycle.externalLinks array of External Documentation Objects.
  • kind is required on each entry. deprecation, successor-version, and sunset are IANA link relation names, so each link maps directly to Link: <url>; rel="<kind>". Other kinds (for example changelog) are documentation only.
  • Lifecycle links go in lifecycle.externalLinks; general docs stay in the operation's own externalLinks.
  • Adds a complete OAS 3.3 example.

deprecated takes precedence

  • deprecated is the authoritative signal. An operation with lifecycle SHOULD set deprecated: true. If deprecated is absent or false, tools MUST treat the operation as not deprecated and ignore lifecycle: no headers, no deprecation annotations.
  • deprecated: true without lifecycle works as before, so APIs can adopt the SAF gradually.

Schema

  • The stub schema (properties: {} + additionalProperties: false) rejected every non-empty Lifecycle Object. The new schema validates the Lifecycle, Sunset, and External Documentation Objects, and requires kind in lifecycle.externalLinks.
  • Adds 5 pass and 19 fail fixtures; schema branch coverage is 100%.

Open questions for the SIG

  • Is lifecycle the right name for the Operation Object field?
  • Version: this spec is 1.0.0, but the #5447 example uses lifecycle: 1.1.0.
  • Still open: Header Mapping is labelled informative but uses SHOULD; there is no rule that sunset.date >= date; the compatibility [TODO] is unfilled.

Test plan

  • oai-spec-test tests/schema — 24 passed, 100% schema coverage
  • yarn validate-markdown (not run locally)

miqui and others added 14 commits September 13, 2026 16:53
Restructures the Lifecycle Object around the operation-scoped
deprecation/sunset model from discussion #5's April 2026+ comments
(the root-level, document-wide draft from earlier in the thread is
superseded) and places it under `features` on the Operation Object,
consistent with the Standardized API Feature (SAF) concept being
defined in OAI/OpenAPI-Specification#5310 and #5350.

Fills in the Introduction, Relationship to the OpenAPI Specification,
Definitions (Lifecycle Object, Sunset Object), a new informative
Header Mapping section (field -> Deprecation/Sunset/Link header
mapping per RFC 9745, RFC 8594, RFC 8288), Appendix A revision
history, and a new informative Appendix B on AI agent/MCP tooling
usage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAmP3nFaRwCARS7JygrV7r
Align lifecycle.md with SAF framing, using discussion #5 example data
minor changes
…ample

- Declare the SAF via the root `features` map (OAS PR #5447) and place the
  Lifecycle Object in a dedicated Operation Object `lifecycle` field
- Add a complete OAS 3.3 example using `externalLinks` from the Docs Links
  proposal alongside the Lifecycle Object
- Fix stale listPets_v2 reference in Appendix B

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Align lifecycle SAF with OAS #5447 features and add external links example
Swap `migration`, `replacement`, and `sunset.policy` for a single
`lifecycle.externalLinks` array of External Documentation Objects, per the
OAS Docs Links proposal. `kind` is required and uses IANA link relation
names (`deprecation`, `successor-version`, `sunset`), so each link maps
directly to a `Link` header; other kinds are documentation only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace named lifecycle link fields with an externalLinks array
The schema was a stub (`properties: {}` with `additionalProperties: false`)
that rejected every non-empty Lifecycle Object. It now validates the
Lifecycle, Sunset, and External Documentation Objects, requiring `kind` on
each `lifecycle.externalLinks` entry and rejecting the removed `migration`,
`replacement`, and `sunset.policy` fields.

Removes the unused Schema Object `$dynamicAnchor` hook and the matching
spec text, since the Lifecycle Object contains no Schema Objects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Define the Lifecycle Object schema and add pass/fail tests
Define `deprecated` as the authoritative deprecation signal. Operations
with `lifecycle` SHOULD set `deprecated: true`; if `deprecated` is absent
or false, tools MUST treat the operation as not deprecated and MUST NOT
generate headers or present it as deprecated from the Lifecycle Object.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make deprecated take precedence over the Lifecycle Object
Comment thread src/schemas/validation/schema.yaml Outdated
type: string
url:
type: string
format: uri

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For consistency, this should be uri-reference.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed to uri-reference in 0c10911, and added a pass fixture with a relative url (tests/schema/pass/relative-link-url.yaml). Thanks!

For consistency with the OAS schema, allow URI references, which are
resolved against the document's base URI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@miqui

miqui commented Oct 30, 2026

Copy link
Copy Markdown
Author

@karenetheridge thanks for the review — I switched url to uri-reference in 0c10911 (see the reply on your comment). Could you take another look when you have a chance?

@miqui
miqui requested a review from karenetheridge October 30, 2026 15:40
spec.openapis.org/oas/v3.3.0.html is not published yet, so the link check
fails. Link the SAF section to the v3.3-dev source and the Operation and
External Documentation Objects to the latest published OAS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants