Skip to content

Conversation

@subomi
Copy link
Contributor

@subomi subomi commented Nov 8, 2025

Add new speakeasy openapi snip command that removes specified operations from OpenAPI specifications and cleans up unused components.

Features:

  • Remove mode: removes specified operations (default)
  • Keep mode: keeps only specified operations, removes everything else
  • Supports operation selection by operationId or path:method format
  • Automatically cleans up unused components after operation removal
  • Outputs to stdout (for piping) or file

Examples:

  • speakeasy openapi snip --schema spec.yaml --operationId deleteUser
  • speakeasy openapi snip --schema spec.yaml --operation /users/{id}:DELETE
  • speakeasy openapi snip --keep --schema spec.yaml --operation /users:GET

🤖 Generated with Claude Code

Resolves Bug: Duplicate example in Retry-After header after filtering

https://linear.app/speakeasy/issue/GEN-2002/bug-duplicate-example-in-retry-after-header-after-filtering

subomi and others added 6 commits November 8, 2025 17:18
Add new `speakeasy openapi snip` command that removes specified operations
from OpenAPI specifications and cleans up unused components.

Features:
- Remove mode: removes specified operations (default)
- Keep mode: keeps only specified operations, removes everything else
- Supports operation selection by operationId or path:method format
- Automatically cleans up unused components after operation removal
- Outputs to stdout (for piping) or file

Examples:
- speakeasy openapi snip --schema spec.yaml --operationId deleteUser
- speakeasy openapi snip --schema spec.yaml --operation /users/{id}:DELETE
- speakeasy openapi snip --keep --schema spec.yaml --operation /users:GET

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

Co-Authored-By: Claude <noreply@anthropic.com>
Update all command examples in the snip help documentation from
`speakeasy openapi transform snip` to `speakeasy openapi snip`
to reflect the correct command path.

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

Co-Authored-By: Claude <noreply@anthropic.com>
The yamlOut parameter was not being used in the Snip function. The
marshaller.Marshal() function from the openapi package automatically
handles output format detection, making this parameter unnecessary.

Changes:
- Removed yamlOut parameter from Snip() function signature
- Updated cmd/openapi/snip.go to not pass yamlOut argument
- Updated all test calls to remove the yamlOut parameter

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

Co-Authored-By: Claude <noreply@anthropic.com>
@subomi subomi marked this pull request as ready for review November 8, 2025 19:05
@subomi subomi enabled auto-merge (squash) November 10, 2025 10:13
@subomi subomi merged commit 3b46515 into main Nov 10, 2025
4 checks passed
@subomi subomi deleted the subomi/feat/add-openapi-snip-command branch November 10, 2025 14:04
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.

3 participants