Ask for JSON on the deletes HEY already answers in JSON

Merged
JE
2mo ago
+1357-173

Extenzions.Delete, CalendarEvents.Delete and CalendarEvents.DeleteOccurrence went through the form client: no .json on the path, Accept: */*, and success read off the 302 the web form gets. Haystack has answered all three with a JSON branch (head :no_content) since 690048ed92, which the pinned route snapshot (2026-08-21) already carries — so the SDK was impersonating a browser for nothing.

Change

  • Model the three as Smithy operations — DeleteExtenzion, DeleteCalendarEvent, DeleteCalendarEventOccurrence — and call the generated client, which puts .json on the path and asks for application/json. Wrappers keep their signatures, so hey-cli needs no change.
  • The occurrence scope rides in the query as a boolean apply_to_future (haystack casts it with ActiveRecord::Type::Boolean); both scopes are sent explicitly rather than leaving the narrower one to the server's default.
  • openapi.json, the generated client, url-routes.json, route-coverage.json and behavior-model.json regenerated; the two calendar routes leave excluded-routes.json. The extenzion route was never listed there — the reverse drift filter skips /accounts/.

Not in this PR

The rest of the card's inventory has no JSON representation in haystack yet (workflows, stages, stagings, snippets, clips, collection create/collecting, publications, bulk-reply undo's success branch, time-track categories, HEY World posts): they answer only a redirect or a Turbo Stream, so the SDK can't ask for JSON there until the API grows one. That list is on the card as an [API] follow-up. CalendarEvents.Create/Update/UpdateOccurrence and Extenzions.Create/Update already post to .json paths and decode JSON — form-encoded bodies, but not browser impersonation — and are left alone here.

Tests

  • Unit tests for the three deletes assert the .json path, Accept: application/json, and a 204 answer; the occurrence test covers both scopes' apply_to_future value.
  • Conformance cases at the HEY layer pin the same wire shape (calendar-events.json, new extenzions.json).
  • make check green (176 conformance cases).

Basecamp: [SDK] There art multiple SDK methods that request HTML instead of JSON


Summary by cubic

These three deletes now ask for the JSON branch HEY already serves (204 No Content) instead of impersonating a web browser through the form client.

  • Extenzions.Delete, CalendarEvents.Delete, and CalendarEvents.DeleteOccurrence now go through the generated client, hitting .json paths with Accept: application/json and reading success from the 204.
  • The occurrence scope is sent as an explicit apply_to_future boolean query param; both scopes are stated so the server default isn't relied on.
  • Public method signatures are unchanged, so hey-cli needs no update.
  • Generated artifacts (openapi.json, Go client, route/behavior files) are regenerated; unit and conformance tests cover the new wire format.