Repository navigation
A sunset endpoint answers apiguide.dev's endpoint-sunset - #27
Conversation
Reviewed and trusted in Vet by Steve. 0.3.3 brings the apiguide.dev catalogue's endpoint-sunset type, which the next commit uses.
RetireSunsetEndpoints answered plain gone, which also fits a deleted record. apiguide.dev now has endpoint-sunset for exactly this, an interface retired on purpose, which tells a client the fault is in its code and asks for the replacement in the body. The 410 throws the new App\Problems\EndpointSunset (made with make:api-problem --apiguide) carrying deprecatedAt, sunsetAt and migrationGuide, the #[Sunset] link or else the #[Deprecation] one.
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
After an endpoint's
#[Sunset]date,RetireSunsetEndpointsanswered410with the plaingonetype, which also covers a deleted record. apiguide.dev now hasendpoint-sunsetfor exactly this case: an interface retired on purpose after its sunset. It tells a client the fault is in its code rather than its data, and asks for the replacement in the body.api-toolbox
^0.3.3, whose catalogue has the type (reviewed and trusted in Vet). It's its own commit.App\Problems\EndpointSunset, made withphp artisan make:api-problem EndpointSunset --apiguide=endpoint-sunset. It's Kit's first typed problem.The 410 throws it, with the members apiguide.dev's entry shows:
deprecatedAtandsunsetAt, as ISO 8601;migrationGuide, which is the#[Sunset]link, or the#[Deprecation]one without it.Absent values are left out. The
DeprecationandSunsetheaders still go with it.Docs:
docs/http-standards.mdand the table in AGENTS.md say so.Tests: the retired endpoint's 410 now asserts the type, title, detail and both dates, with no
migrationGuidebecause it has no links. The clock-travel test asserts the type and thatmigrationGuideis the sunset link. Both fail on the old middleware. The full suite (166) passes, and Rector, PHPStan and Pint are clean.A breaking change for any client that branched on
gonefor a sunset endpoint, so worth a line in the release notes.Summary by CodeRabbit
410 Goneresponse with theendpoint-sunsetproblem type, rather than a plain410.