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.
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 theheadersoption, 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
responseHeadersoption toHttpApiEndpointthat accepts aSchema.Struct, mirroring how requestheadersworks. 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.