feat(codegen): name operations from the route when the operationId is mechanical - #548
Merged
Conversation
… mechanical
Many specs in the SDK batch have no operationId (Resend, Superset, OVH) or
a mechanical one that just restates the route (`get-api-card`,
`post_v1_users_id`, `postV1AppsByAppIdPromote`, Stripe's
`PostAccountsAccount`). toVerbNoun left those as `getApiCard` /
`postV1UsersId`, which is not verbNoun.
The OpenAPI converter now classifies each operationId:
- absent → named from the route: `GET /users` → listUsers (when the 200
body is a collection, else getUsers), `GET /users/{id}` → getUser,
`POST /users` → createUser, `POST /users/{id}` → updateUser,
`POST /users/{id}/reset` → resetUser. `/api` and `/vN` roots are dropped.
- verbatim route id (`getV1AppsByAppId`, `GetAccountsAccount`,
`getCustomerById`) → same derivation, but the author's verb is kept and
parameter clauses (`ByAppId`, `Id`, an echoed `{account}`) are dropped.
- method-prefixed with chosen nouns (`get-feeds`, `deleteScheduledJob`,
`get_webhook_by_token`) → nouns kept verbatim; only `post`/`patch` and a
trailing `ById` are normalised.
- anything else → toVerbNoun as before.
Two routes that derive the same name (`/collections/{slug}` and
`/collections/{slug}-{id}`) get a `By<param>` suffix instead of a counter.
Regular `-ys` plurals (`keys`, `days`) now singularise. 224 cases.
Regenerated: 75 files; the renames are confined to mechanical ids
(Stripe `postAccountsAccount` → `updateAccount`, Coinbase `…ById`,
prisma-postgres `postV1…`, Vercel's `ByTeamSlugByProjectSlug…` chains).
Contributor
|
Install the packages built from this commit: Distilled@distilled.cloud/core bun add https://pkg.ing/@distilled.cloud/core/1a57f14@distilled.cloud/aws bun add https://pkg.ing/@distilled.cloud/aws/1a57f14@distilled.cloud/axiom bun add https://pkg.ing/@distilled.cloud/axiom/1a57f14@distilled.cloud/azure bun add https://pkg.ing/@distilled.cloud/azure/1a57f14@distilled.cloud/cloudflare bun add https://pkg.ing/@distilled.cloud/cloudflare/1a57f14@distilled.cloud/coinbase bun add https://pkg.ing/@distilled.cloud/coinbase/1a57f14@distilled.cloud/discord bun add https://pkg.ing/@distilled.cloud/discord/1a57f14@distilled.cloud/expo-eas bun add https://pkg.ing/@distilled.cloud/expo-eas/1a57f14@distilled.cloud/fly-io bun add https://pkg.ing/@distilled.cloud/fly-io/1a57f14@distilled.cloud/gcp bun add https://pkg.ing/@distilled.cloud/gcp/1a57f14@distilled.cloud/github bun add https://pkg.ing/@distilled.cloud/github/1a57f14@distilled.cloud/hetzner bun add https://pkg.ing/@distilled.cloud/hetzner/1a57f14@distilled.cloud/kubernetes bun add https://pkg.ing/@distilled.cloud/kubernetes/1a57f14@distilled.cloud/mongodb-atlas bun add https://pkg.ing/@distilled.cloud/mongodb-atlas/1a57f14@distilled.cloud/neon bun add https://pkg.ing/@distilled.cloud/neon/1a57f14@distilled.cloud/planetscale bun add https://pkg.ing/@distilled.cloud/planetscale/1a57f14@distilled.cloud/posthog bun add https://pkg.ing/@distilled.cloud/posthog/1a57f14@distilled.cloud/prisma-postgres bun add https://pkg.ing/@distilled.cloud/prisma-postgres/1a57f14@distilled.cloud/railway bun add https://pkg.ing/@distilled.cloud/railway/1a57f14@distilled.cloud/stripe bun add https://pkg.ing/@distilled.cloud/stripe/1a57f14@distilled.cloud/supabase bun add https://pkg.ing/@distilled.cloud/supabase/1a57f14@distilled.cloud/turso bun add https://pkg.ing/@distilled.cloud/turso/1a57f14@distilled.cloud/typesense bun add https://pkg.ing/@distilled.cloud/typesense/1a57f14@distilled.cloud/vercel bun add https://pkg.ing/@distilled.cloud/vercel/1a57f14@distilled.cloud/workos bun add https://pkg.ing/@distilled.cloud/workos/1a57f14 |
Mkassabov
added a commit
that referenced
this pull request
Sep 7, 2026
…peline Rebased on main after #545/#548. Two pre-existing typecheck failures are fixed on the way: the offset pagination stamp now uses the core `token` mode (nextOffset is fed back as offset verbatim, which is what token mode does), and the root re-exports only Conflict — the spec declares 409 and nothing else, so BadRequest/Forbidden/NotFound were never emitted.
This was referenced Sep 7, 2026
Mkassabov
added a commit
that referenced
this pull request
Sep 7, 2026
…peline Rebased on main after #545/#548. Two pre-existing typecheck failures are fixed on the way: the offset pagination stamp now uses the core `token` mode (nextOffset is fed back as offset verbatim, which is what token mode does), and the root re-exports only Conflict — the spec declares 409 and nothing else, so BadRequest/Forbidden/NotFound were never emitted.
Mkassabov
added a commit
that referenced
this pull request
Sep 7, 2026
Rebased on main after #545/#548/#549. convert ends in finalizeConvert. Operation names are verbNoun: a camelCase Slack action is used as-is (chat.postMessage → postMessage); a bare action is handed to the converter as Object_action so its policy orders it (admin.apps.permissions.add → addAppsPermissions, conversations.archive → archiveConversation). package.json uses the named pnpm catalogs, and slack is registered as a blocked spec repo (the docs JSON twins are committed in-repo).
Mkassabov
added a commit
that referenced
this pull request
Sep 7, 2026
Rebased on main after #545/#548/#549. convert ends in finalizeConvert. Operation names are verbNoun: a camelCase Slack action is used as-is (chat.postMessage → postMessage); a bare action is handed to the converter as Object_action so its policy orders it (admin.apps.permissions.add → addAppsPermissions, conversations.archive → archiveConversation). package.json uses the named pnpm catalogs, and slack is registered as a blocked spec repo (the docs JSON twins are committed in-repo).
wyattjoh
added a commit
to wyattjoh/distilled
that referenced
this pull request
Sep 7, 2026
Ports codegen/patches.ts, codegen/rewrite-operation-ids.ts, and codegen/spec-path.ts from main (alchemy-run#545, alchemy-run#548, alchemy-run#549). Purely additive: no package on this branch imports them yet. isStaleTargetError is called with the message rather than the thrown value, so core/json-patch.ts stays untouched.
wyattjoh
added a commit
to wyattjoh/distilled
that referenced
this pull request
Sep 8, 2026
Ports codegen/patches.ts, codegen/rewrite-operation-ids.ts, and codegen/spec-path.ts from main (alchemy-run#545, alchemy-run#548, alchemy-run#549). Purely additive: no package on this branch imports them yet. isStaleTargetError is called with the message rather than the thrown value, so core/json-patch.ts stays untouched.
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.
Follow-up to #545, needed before the SDK batch (#484–#533) is regenerated.
Many of those specs have no
operationId(Resend, Superset, OVH) or a mechanical one that only restates the route (get-api-card,post_v1_users_id,postV1AppsByAppIdPromote, Stripe'sPostAccountsAccount).toVerbNounleft those asgetApiCard/postV1UsersId.The OpenAPI converter now classifies each
operationId:listonly when the 200 body is a collectionGET /users→listUsers,GET /users/{id}→getUser,POST /users/{id}/reset→resetUsergetV1AppsByAppId,GetAccountsAccount,getCustomerById)POST /x/{id}→updatePostAccountsAccount→updateAccountget-feeds,deleteScheduledJob,get_webhook_by_token)post/patchand a trailingByIdnormalisedgetCustomerById→getCustomertoVerbNounas before/apiand/vNroots are dropped. Two routes that derive the same name (/collections/{slug},/collections/{slug}-{id}) get aBy<param>suffix instead of a counter. 224 test cases inrewrite-operation-ids.test.ts.Regenerated 75 files across the tracked packages; the renames are confined to mechanical ids (Stripe, Coinbase, prisma-postgres, Vercel's
ByTeamSlugByProjectSlug…chains).