Repository navigation
Deprecate a query form of a route on its own - #4
Merged
Merged
Conversation
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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A URI's query is part of what identifies the resource (RFC 3986 section 3), so
GET /contacts?organization_id=Xis a resource of its own. RFC 9745 lets it be deprecated whileGET /contactsis not. ButAttributeSourcefound 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 takequery:and apply only when the request carries that parameter:AttributeSourcestill reads the attributes once per action, but picks the notice per request, resolving the request when asked because the source is a singleton (Octane).DeprecationSourceis unchanged, so custom sources keep working.Tests: the query form gets
Deprecation,Sunsetand 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.