Skip to content

fix(codegen)!: name a GET of /me as one item, -get, not -list - #636

Merged
leemour merged 1 commit into
mainfrom
fix/codegen-me-is-get
Nov 17, 2026
Merged

leemour merged 1 commit into
mainfrom
fix/codegen-me-is-get

Conversation

@leemour

@leemour leemour commented Nov 17, 2026

Copy link
Copy Markdown
Member

Task

Notion's official OpenAPI description, generated with @wirecat/cli-template 0.27.0, gave users-me-list for GET /v1/users/me.

Why

A path ending in /me reads the caller's own record, never a list. Command names are a contract, so this is under "Changed — may break callers".

What

  • commandFromPath: a GET whose last segment is me gets the verb get.
  • Not changed: a path whose last fixed word follows a parameter (/pages/{id}/markdown) stays -list, since the path alone cannot tell it from a real list (/blocks/{id}/children, /data-sources/{id}/templates, Stripe's /customers/{id}/sources). A CLI names it in commands.

Testing

  • New test in src/codegen/swagger.test.ts: users-list, users-me-get, blocks-children-list.
  • vitest run src/codegen: 120 passed. Lint, typecheck, docs:check pass.

🤖 Generated with Claude Code

Notion's GET /v1/users/me came out as users-me-list from names.fromPath.
A path ending in /me reads the caller's own record, never a list. A path
whose last fixed word follows a parameter stays -list: the path alone
cannot tell /pages/{id}/markdown from /blocks/{id}/children.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour force-pushed the fix/codegen-me-is-get branch from 94b6337 to 9d4b4d9 Compare November 17, 2026 21:22
@leemour
leemour merged commit c469ff3 into main Nov 17, 2026
10 checks passed
@leemour
leemour deleted the fix/codegen-me-is-get branch November 17, 2026 21:26
@leemour leemour mentioned this pull request Nov 17, 2026
leemour added a commit that referenced this pull request Nov 17, 2026
Dates Unreleased as 0.116.0: GET /me is named -get (#636).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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