Skip to content

Deprecate a query form of a route on its own - #4

Merged
JustSteveKing merged 1 commit into
mainfrom
feature/deprecate-a-query-form
Oct 29, 2026
Merged

JustSteveKing merged 1 commit into
mainfrom
feature/deprecate-a-query-form

Conversation

@JustSteveKing

Copy link
Copy Markdown
Owner

A URI's query is part of what identifies the resource (RFC 3986 section 3), so GET /contacts?organization_id=X is a resource of its own. RFC 9745 lets it be deprecated while GET /contacts is not. But AttributeSource found notices by route alone, and the two share a route, so there was no way to say it with the attributes.

#[Deprecation] and #[Sunset] now take query: and apply only when the request carries that parameter:

#[Deprecation(at: '2026-10-29T00:00:00Z', link: 'https://docs.example.com/deprecations/contact-filter', query: 'organization_id')]
#[Sunset(at: '2027-01-31T23:59:59Z', query: 'organization_id')]
final class ListContactsController
  • Both attributes are repeatable, so a controller can carry a notice for itself and another for a query form. A query form's notice the request matches wins over one without a query, and an action's wins over its controller's within each.
  • AttributeSource still reads the attributes once per action, but picks the notice per request, resolving the request when asked because the source is a singleton (Octane).
  • DeprecationSource is unchanged, so custom sources keep working.
  • README and the Boost skill's lifecycle reference document it. The README's "Field-level deprecation: not supported" stays true.

Tests: the query form gets Deprecation, Sunset and its link while the plain route gets none of them, and a scoped notice is preferred to an action's own and falls back to it without the query. Both fail with the query matching removed. The full suite (2966) passes, PHPStan and Pint are clean.

Found by Pingback (ADR-0008), which had to decorate the source to do this. It could drop that decorator for the attributes once this is released.

A URI's query is part of what identifies the resource (RFC 3986
section 3), so /contacts?organization_id=X is a resource of its own,
and RFC 9745 lets it be deprecated while /contacts is not. Notices
were found by route only, which both share. #[Deprecation] and
#[Sunset] take query:, and apply only when the request carries that
parameter; both are repeatable, and a query form's notice wins over
the route's. The source reads the request when asked, as it is a
singleton under Octane. Found by Pingback, which had to decorate the
source to do this.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1cd50d4d-47d7-45fa-93b2-24388fae5488
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JustSteveKing JustSteveKing self-assigned this Oct 29, 2026
@JustSteveKing
JustSteveKing merged commit b4b80ec into main Oct 29, 2026
7 checks passed
@JustSteveKing
JustSteveKing deleted the feature/deprecate-a-query-form branch October 29, 2026 13:20
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