Skip to content

Feature/x sdk method name plugin#85

Draft
aeroplaniko wants to merge 2 commits intomainfrom
feature/x-sdk-method-name-plugin
Draft

Feature/x sdk method name plugin#85
aeroplaniko wants to merge 2 commits intomainfrom
feature/x-sdk-method-name-plugin

Conversation

@aeroplaniko
Copy link
Collaborator

No description provided.

spm_sitecore and others added 2 commits February 6, 2026 11:50
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>
@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

⚠️ No Changeset found

Latest commit: f523ae5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -0,0 +1,350 @@
import { describe, it, expect, vi } from 'vitest';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import vi.

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.

Suggested changeset 1
packages/xmc/plugins/sdk-method-name/plugin.spec.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/xmc/plugins/sdk-method-name/plugin.spec.ts b/packages/xmc/plugins/sdk-method-name/plugin.spec.ts
--- a/packages/xmc/plugins/sdk-method-name/plugin.spec.ts
+++ b/packages/xmc/plugins/sdk-method-name/plugin.spec.ts
@@ -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
EOF
@@ -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
Copilot is powered by AI and may make mistakes. Always verify output.
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