Component Headers

Demonstrates how to define reusable header components for OpenAPI responses.

Note: This feature is currently not yet implemented in Kestrun. The example below is a placeholder for future support.

Full source

File: pwsh/tutorial/examples/10.9-OpenAPI-Component-Header.ps1

<#
    Sample: OpenAPI Header Components
    Purpose: Demonstrate reusable request header components with multiple content types.
    File:    10.9-OpenAPI-Component-Header.ps1
    Notes:   Shows class inheritance, component wrapping, and content type negotiation.
#>

throw "This example is not yet implemented."


Step-by-step

  1. Not Implemented: This feature is planned for a future release.
  2. Concept: Headers allow defining custom response headers (e.g., X-Rate-Limit) that can be reused across multiple API operations.

Try it

This example cannot be executed yet.

Troubleshooting

Issue: Feature not implemented.

  • Status: This feature is planned for a future release of Kestrun.
  • Workaround: Use response schemas with [OpenApiResponseComponent] to document response structure; custom headers can be added to individual route responses once this feature is available.

References


Previous / Next

Previous: Document Info Next: Component Links