Conversation
Add a new Hey API plugin that allows overriding generated SDK method names using the `x-sdk-method-name` OpenAPI extension. Features: - Reads x-sdk-method-name from operation extensions - Validates identifier format (^[A-Za-z_][A-Za-z0-9_]*$) - Ensures uniqueness per tag/client bucket to prevent collisions - Falls back to default operationId-based naming when absent Changes: - Add new plugin at packages/xmc/plugins/sdk-method-name/ - Wire plugin into generate-xmc.ts and generate-xmc-experimental.ts - Add example x-sdk-method-name to RenameSite operation in xmapp.yaml - Add comprehensive tests (22 test cases) - Add documentation at docs/codegen/x-sdk-method-name.md Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
| @@ -0,0 +1,350 @@ | |||
| import { describe, it, expect, vi } from 'vitest'; | |||
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
In general, unused imports should be removed from the import list so that only the actually used symbols remain. This avoids confusion, keeps the codebase cleaner, and can slightly improve tooling performance.
The best fix here is to update the vitest import line at the top of packages/xmc/plugins/sdk-method-name/plugin.spec.ts to remove vi, leaving only describe, it, and expect. No other code changes are required, because the rest of the file does not reference vi. No additional methods, imports, or definitions are needed.
| @@ -1,4 +1,4 @@ | ||
| import { describe, it, expect, vi } from 'vitest'; | ||
| import { describe, it, expect } from 'vitest'; | ||
| import { handler } from './plugin'; | ||
|
|
||
| // Helper to create a mock operation |
No description provided.