Skip to content

Add response headers support to HttpApiEndpoint #2026

Description

@filipfalcon

What is the problem this feature would solve?

There's currently no way to declaratively define response headers on an HttpApiEndpoint. Request headers can be defined via the headers option, but response headers must be set imperatively in handlers and don't appear in the generated OpenAPI specification.

What is the feature you are proposing to solve the problem?

Add a responseHeaders option to HttpApiEndpoint that accepts a Schema.Struct, mirroring how request headers works. Defined response headers should be rendered in the OpenAPI specification under the endpoint's response object.

What alternatives have you considered?

Setting response headers imperatively in handlers via HttpServerResponse.setHeader, but this bypasses the schema layer entirely — headers aren't type-checked and don't appear in the generated OpenAPI spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions