Proposal to Support `headers` Field in `HttpApiSchema.annotations(...)`
Could we support a
Something like this:
headersheaders fields on HttpApiSchema.annotations(...)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
}/**
* @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
}