Proposal to Support `headers` Field in `HttpApiSchema.annotations(...)`

Could we support a headers fields on HttpApiSchema.annotations(...)?

Something like this:
/**
 * @since 1.0.0
 * @category annotations
 */
export const annotations = <A>(
  annotations: Schema.Annotations.Schema<NoInfer<A>> & {
    readonly status?: number | undefined
    readonly headers?: Record<string, string>
  }
): Schema.Annotations.Schema<A> => {
  const result: Record<symbol, unknown> = Struct.omit(annotations, "status", "headers")
  if (annotations.status !== undefined) {
    result[AnnotationStatus] = annotations.status
  }
  if (annotations.headers !== undefined) {
    result[AnnotationHeaders] = annotations.headers
  }
  return result
}
Was this page helpful?