(schema: Schema.Top)
| 1715 | } |
| 1716 | |
| 1717 | function transformResponse(schema: Schema.Top): Schema.Top { |
| 1718 | const encoding = HttpApiSchema.getResponseEncoding(schema.ast) |
| 1719 | const withHeaders = HttpApiSchema.getWithHeadersAnnotation(schema.ast) |
| 1720 | if (withHeaders === undefined) { |
| 1721 | return applyResponseEncoding(schema, encoding) |
| 1722 | } |
| 1723 | return schema.annotate({ |
| 1724 | "~httpApiWithHeaders": { |
| 1725 | ...withHeaders, |
| 1726 | bodyCodec: applyResponseEncoding(withHeaders.body, encoding), |
| 1727 | headersCodec: toCodecHttpProperties(withHeaders.headers) |
| 1728 | } |
| 1729 | }) |
| 1730 | } |
| 1731 | |
| 1732 | function applyResponseEncoding(schema: Schema.Top, encoding: HttpApiSchema.ResponseEncoding): Schema.Top { |
| 1733 | switch (encoding._tag) { |
no test coverage detected