Skip to content

Drop field-level deprecation headers from #2224; track field removal in API v4 discussion#2350

Open
Flix6x wants to merge 2 commits into
feat/api/use-202-status-consistenly-in-triggering-and-fetching-endpointsfrom
followup/2224-conventional-deprecation
Open

Drop field-level deprecation headers from #2224; track field removal in API v4 discussion#2350
Flix6x wants to merge 2 commits into
feat/api/use-202-status-consistenly-in-triggering-and-fetching-endpointsfrom
followup/2224-conventional-deprecation

Conversation

@Flix6x

@Flix6x Flix6x commented Jul 22, 2026

Copy link
Copy Markdown
Member

Description

Follow-up to #2224 (base branch: feat/api/use-202-status-consistenly-in-triggering-and-fetching-endpoints), addressing feedback discussed there on the deprecation/discoverability design for the new response fields.

Why

#2224 introduced a custom FlexMeasures-Deprecated-Response-Fields response header (plus reused Deprecation/Link headers) to signal that the legacy schedule/forecast/snake_case job-status fields are deprecated in favor of job/kebab-case fields, all within API version v3_0.

On review we concluded this design has three problems:

  1. No real removal plan. The deprecation date (suggested to be) shipped in use the 202 status consistently in triggering endpoints  #2224 was a single hardcoded constant (JOB_RESPONSE_FIELDS_DEPRECATION_DATE), not tied to when any host actually deploys the change, and not backed by a decided target version. A Deprecation header is supposed to be an actionable signal ("plan your migration by X"); shipping it without a committed timeline undermines that for this and future deprecations.
  2. A non-standard header. Neither RFC 8594 (Sunset) nor the IETF Deprecation header draft define field-level deprecation — FlexMeasures-Deprecated-Response-Fields is our own invention, and worse, it inverts the usual relationship: a client has to check for this custom header just to know how to interpret the standard Deprecation header (endpoint-wide vs. field-scoped).
  3. Inconsistent with our own established pattern. flexmeasures/api/sunset/__init__.py already deprecates/sunsets whole API versions with paired deprecation_date/sunset_date, decided together, once a replacement exists. Signalling field-level deprecation before a replacement version even exists inverts that sequencing.

What changed here

  • Removed deprecated_response_fields_headers() and the FlexMeasures-Deprecated-Response-Fields header entirely.
  • job (and, for job status, the kebab-case fields) are added purely additively next to the existing schedule/forecast/snake_case fields — no header signalling, no formal HTTP deprecation.
  • Removed the now-unused flexmeasures/api/v3_0/deprecations.py module and its hardcoded deprecation date.
  • Updated documentation/api/introduction.rst and documentation/api/change_log.rst to describe the additive fields plainly, with a docs note recommending new clients use the canonical fields, and a link to the tracking discussion below.
  • Kept the 202/422/200 status-code work from use the 202 status consistently in triggering endpoints  #2224 unchanged — that's a same-version bug fix (status code stays within the 2xx success range), not a breaking API change.

Where the actual removal will happen

Opened #2349 ("Planned API v4: candidate breaking changes and deprecation tracking") as a living list of changes deferred to a future major API version. Removing schedule/forecast/snake_case job-status fields is tracked there as the first candidate. There is no immediate plan to create v4 — the discussion exists so candidate breaking changes have one place to land, and so it can double as a starting point for an eventual upgrade guide.

How to test

No behavioral change to status codes or to the new job/kebab-case fields introduced in #2224 — only the deprecation-signalling headers and hardcoded date are removed, and legacy fields keep working exactly as before. Existing tests from #2224 were updated to drop assertions on the removed headers; no new test scenarios were needed since nothing user-facing about the successful-response shape changed.

Flix6x and others added 2 commits July 22, 2026 22:39
…dditive

The `job`/`schedule`/`forecast` and kebab-case/`snake_case` job-status
field pairs stay additive within v3_0, with no per-field `Deprecation`/
`Link`/`FlexMeasures-Deprecated-Response-Fields` signalling. That custom
header wasn't standard, forced clients to special-case it before they
could even interpret the standard `Deprecation` header, and was carrying
a deprecation date with no committed removal plan behind it.

Any eventual removal of the legacy fields is deferred to a future major
API version, following the existing whole-endpoint deprecation/sunset
mechanism, rather than field-by-field within v3_0.

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

1 participant