Skip to content

feat: add OpenAPI support for Extension<T> parameters#20

Merged
Kilerd merged 1 commit intomainfrom
add-extension-schema-support
Feb 4, 2026
Merged

feat: add OpenAPI support for Extension<T> parameters#20
Kilerd merged 1 commit intomainfrom
add-extension-schema-support

Conversation

@Kilerd
Copy link
Copy Markdown
Owner

@Kilerd Kilerd commented Feb 4, 2026

Summary

Add OpenAPI schema generation support for Extension<T> parameters, allowing handlers to use middleware-injected values without polluting the OpenAPI documentation.

Changes

  • Implement ParameterProvider for Extension<T> with empty parameter generation
  • Re-export Extension from lib.rs and prelude for user convenience
  • Add comprehensive example demonstrating Extension with OpenAPI
  • Add test verifying Extension parameters work correctly with the #[api] macro

Impact

Extension parameters are now properly excluded from OpenAPI specs, similar to State and Request. This enables cleaner API documentation when using middleware-injected context.

🤖 Generated with Claude Code

- Add Extension to imports in openapi/schematic.rs
- Implement ParameterProvider trait for Extension<T> with empty parameter generation
- Re-export Extension from lib.rs and prelude for user convenience
- Add test to verify Extension parameters work with the api macro
- Extension parameters are now properly excluded from OpenAPI specs, similar to State and Request

This allows handlers to use Extension<T> for middleware-injected values without polluting the OpenAPI documentation with parameters that don't come from the HTTP request.
@Kilerd Kilerd merged commit c2916fa 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