Skip to content

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

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

miqui wants to merge 26 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 Resolved
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>
@miqui

miqui commented Nov 5, 2026

Copy link
Copy Markdown
Author

pinning this here for review: OAI/OpenAPI-Specification#5585

Comment thread src/lifecycle.md Resolved
Comment thread src/lifecycle.md Resolved
@baywet

baywet commented Nov 5, 2026

Copy link
Copy Markdown
Member

another thing that came up during the meeting is that we should get generic tooling vendors and get their opinions on the current shape of the spec, especially for scenarios where the lifecycle information and what shows up at runtime disagree.

…ement

Add the Deprecation, Sunset, and Link headers a server would emit for the
complete example, with the Lifecycle Object field each comes from. Add an
editor's note that the Lifecycle Object will move under the SAF container
field once the OAS defines it.

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

miqui commented Nov 6, 2026 •

Copy link
Copy Markdown
Author

Thanks @baywet, agreed: vendor input on the current shape would be valuable before this settles. To make it concrete, here are the disagreement scenarios I'd suggest putting to them:

  1. Spec says deprecated, runtime doesn't: the operation has deprecated: true and a lifecycle object, but responses carry no Deprecation/Sunset headers. Which should a client or agent trust?
  2. Runtime says deprecated, spec doesn't: responses carry Deprecation/Sunset, but the OAD has no lifecycle and/or deprecated is absent. Should tooling surface the runtime signal anyway?
  3. Spec and runtime disagree on dates or links: for example, sunset.date in the OAD differs from the Sunset header, or Link relations point to different URLs.
  4. lifecycle present but deprecated absent or false: Lifecycle SAF: align with OAS #5447, adopt externalLinks, define schema #16 currently says deprecated takes precedence and lifecycle is ignored. Is that what tools would expect?
  5. Inconsistent dates: sunset.date earlier than date. Should this be invalid, or a warning?

For context, the spec currently treats the OAD as the design-time source and the headers as an optional runtime byproduct (see Header Mapping and Relationship to deprecated). It doesn't yet say which side wins when they disagree, apart from the deprecated precedence rule, and point 5 isn't covered at all.

Happy to collect the feedback in a discussion on this repo if that's useful. Are there specific vendors you'd suggest reaching out to?

@handrews handrews left a comment

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.

I haven't gotten through all of this (and I am wondering if we could perhaps break this up to make it easier to resolve pieces and make progress?) but I wanted to publish this before tomorrow's call. My feedback is on details, the direction is good.

Comment thread src/lifecycle.md Resolved
Comment thread src/lifecycle.md Outdated
Comment on lines +46 to +49
**Non-goal.** This SAF does not replace `deprecated: true`, which
remains the coarse signal tooling already recognizes (for example, to gray out
an operation in Swagger UI). The Lifecycle Object is additional detail used
alongside it.

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.

In my view, framing like "Non-goal" is more of a proposal sort of thing. Since this is addressed in detail where usage is described, I would just leave it there. Mentioning it in the introduction without context or crosslink is a bit confusing.

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.

Removed in 65659c4; the Relationship to deprecated section covers it.

Comment thread src/lifecycle.md Resolved
Comment thread src/lifecycle.md Outdated
Comment on lines +114 to +115
meant to complement — not replace — `deprecated: true` on the same Operation
Object.

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.

I find "complement — not replace" to be a bit vague, but fortunately you have the more precise info available. Based on other text, the Lifecycle Object expands on the meaning of deprecated: true since that is required to be set in order for a Lifecycle Object to be usable.

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.

Reworded in bd72f5c: the Lifecycle Object "expands on the meaning of deprecated: true: it applies only to an Operation Object that sets deprecated: true", with a link to the Relationship to deprecated section. I'll revisit the exact wording there along with your MUST-error suggestion.

Comment thread src/lifecycle.md Resolved
Comment thread src/lifecycle.md Resolved
Comment thread src/lifecycle.md Resolved
Comment thread src/lifecycle.md Resolved
…ion note

- Replace "complement — not replace" with a precise statement: the
  Lifecycle Object expands on `deprecated: true` and applies only when it
  is set.
- Remove the sentence saying the spec requires an OAS version with
  `externalLinks`; SAFs are 3.3+ anyway, and it implied otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miqui and others added 2 commits November 19, 2026 08:54
An Operation Object with `lifecycle` MUST set `deprecated: true`; otherwise
the OpenAPI Description is invalid and tools MUST report an error instead of
silently ignoring the Lifecycle Object. Future deprecations are announced
with `deprecated: true` and a future `date`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When `lifecycle` is declared in `features`, the Lifecycle Object is the
only way to describe `Link` headers with the `deprecation`,
`successor-version`, or `sunset` relation, on every operation. A `Link`
Header Object in a Response Object MUST NOT describe them, and tools MUST
report an error if it does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@miqui
miqui requested review from baywet and handrews November 19, 2026 15:13
Comment thread src/lifecycle.md Resolved
@lornajane

Copy link
Copy Markdown
Contributor

From the TDC call, we had some comments on the structure of the document.

The fields here come from other existing specifications, but they aren't called out early enough in the document and didn't seem to be mentioned alongside the fields that represent them in the SAF. We're suggesting refactoring to put the related concepts closer together and reference the RFCs before showing the implementation.

The links for each of the different objects could be nested with the areas they belong to, for example having externalLinks under the sunset section and the deprecated section rather than relying on the kind entries. For links that are part of the RFC such as the successor version, it might make more sense to make those named fields that hold the expected link formats rather than being externalLinks at all.

@baywet

baywet commented Nov 19, 2026 •

Copy link
Copy Markdown
Member
paths:
  '/foo':
    get:
      deprecated: true
      featureFields:
        lifecycle:
          deprecation:
            date: 'some date'
          sunset:
            date: 'some other date'
            successorLink: 'https://example.com'

SAF objects go under a `featureFields` container rather than directly on
core objects; `features` stays the SAF version map. Move `lifecycle` under
the Operation Object's `featureFields` in the text and examples, rename
"Operation Object Fields" to "Feature Fields", and replace the
provisional-placement editor's note with one noting that `featureFields` is
still to be defined by the OAS.
The relationship between the Lifecycle Object and `deprecated: true` is covered in the Relationship to `deprecated` section.
Replace the restated rules on the `features` default and multi-document SAF declarations with a link to the OAS section, so they cannot drift.
Per TDC review, replace the kind-keyed lifecycle.externalLinks with Deprecation and Sunset Objects. Links that map to HTTP link relations are named Link Object fields (deprecation.infoLink, deprecation.successorLink, sunset.policyLink); other resources go in documentation-only externalLinks within each section. Add an HTTP Deprecation and Sunset Signals section introducing the RFCs before the objects, and update the header mapping, examples, schema, and tests.
@miqui

miqui commented Nov 21, 2026

Copy link
Copy Markdown
Author

@lornajane @baywet thanks for the structure feedback from the TDC call. I've restructured the document in 44d44a7:

  • RFCs first: a new "HTTP Deprecation and Sunset Signals" section near the top lists each header and link relation, the RFC that defines it, and the Lifecycle Object field that represents it.
  • Links grouped with their sections, as named fields: the kind-keyed externalLinks is gone. The shape now follows baywet's sketch:
featureFields:
  lifecycle:
    deprecation:
      date: "2025-01-15T00:00:00Z"   # Deprecation header
      reason: "..."
      infoLink:                      # rel="deprecation"
        url: https://docs.example.com/migrate
      successorLink:                 # rel="successor-version"
        url: https://api.example.com/v2/openapi.yaml
      externalLinks: [...]           # documentation only
    sunset:
      date: "2025-07-01T00:00:00Z"   # Sunset header
      policyLink:                    # rel="sunset"
        url: https://docs.example.com/sunset-policy
      externalLinks: [...]           # documentation only
  • Named links are small Link Objects (url, plus optional summary/description). The field determines the link relation, so they have no kind. Each section's externalLinks is for other resources (changelog, announcement) and never generates headers.

Two choices that differ from the sketch:

  • successorLink is under deprecation rather than sunset, since a replacement can exist without a sunset date.
  • It's a single link. @baywet, is one enough, or should it allow several (for example both a v2 and a v3)?

Rewrite the Scope paragraph to state the rule and the Overlays approach without the decision history. A lifecycle key in the featureFields of any object other than an Operation Object is now invalid, and tools MUST report an error.
@miqui
miqui requested a review from lornajane November 21, 2026 04:12
@miqui

miqui commented Nov 21, 2026

Copy link
Copy Markdown
Author

@handrews Thanks a lot for your help and feedback, but I am tired and I don't want to split this PR. I would much rather get this merged and continue with other PRs. AFAIK, I have done all I can for this SAF PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/lifecycle.md Resolved
Comment thread src/lifecycle.md

| Field Name | Type | Description |
| ---- | ---- | ---- |
| `date` | `string` (date-time) | **REQUIRED.** The date the deprecation takes or took effect. Maps to the `Deprecation` header. |

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.

I think we need to formalize what date-time means here, probably RFC3339 or replacement or so.

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.

the core spec doesn't define/refer to a date-time format because it doesn't have date-time fields as far as I can remember/find with a quick search.

The only place we "define" this is the formats registry https://spec.openapis.org/registry/format/date-time.html, but that's non normative.

So I think this SAF need to refer to that RFC and clarify the "date-time" fields actually mean RFC3339 date-time

@lornajane

Copy link
Copy Markdown
Contributor

Update from the TDC call, consensus that we're on good lines here. It needs some copyediting for wording, help very gratefully received on that (and I'll also try to take a look).

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.

6 participants