Skip to content

feat: implement #[api(skip)] for OpenAPI parameter exclusion#22

Merged
Kilerd merged 1 commit into
mainfrom
config-simplification
Feb 4, 2026
Merged

feat: implement #[api(skip)] for OpenAPI parameter exclusion#22
Kilerd merged 1 commit into
mainfrom
config-simplification

Conversation

@Kilerd
Copy link
Copy Markdown
Owner

@Kilerd Kilerd commented Feb 4, 2026

Summary

Implement the #[api(skip)] attribute to exclude specific handler parameters from OpenAPI documentation. This allows developers to hide internal parameters like Extension and State from the generated OpenAPI spec.

Changes

  • Add skip attribute detection logic in gotcha_macro route handler
  • Preserve non-api attributes when processing function parameters
  • Fix workspace compilation by excluding cloudflare-worker example
  • Add comprehensive test cases demonstrating skip functionality
  • Clean up compiler warnings

Test Plan

  • Run cargo test --workspace to verify all tests pass
  • Visit /redoc or /openapi.json on the example to verify skip functionality works correctly

🤖 Generated with Claude Code

Add support for skipping specific handler parameters in OpenAPI documentation generation via the #[api(skip)] attribute. This allows developers to exclude internal parameters (like Extension, State) from the OpenAPI spec.

Changes:
- Simplify parameter skip detection logic in route.rs macro
- Preserve non-api attributes when processing function parameters
- Fix workspace compilation by excluding cloudflare-worker example
- Add comprehensive test cases demonstrating skip functionality
- Clean up compiler warnings

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@Kilerd Kilerd merged commit 584ae41 into main Feb 4, 2026
65 of 71 checks passed
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