MCPcopy Create free account
hub / github.com/Effect-TS/effect / transformResponse

Function transformResponse

packages/effect/src/http-api/HttpApiEndpoint.ts:1717–1730  ·  view source on GitHub ↗
(schema: Schema.Top)

Source from the content-addressed store, hash-verified

1715}
1716
1717function 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
1732function applyResponseEncoding(schema: Schema.Top, encoding: HttpApiSchema.ResponseEncoding): Schema.Top {
1733 switch (encoding._tag) {

Callers 4

HttpApiEndpoint.tsFile · 0.85
HttpClient.tsFile · 0.85
withScopeFunction · 0.85
layerMergedContextFunction · 0.85

Calls 3

toCodecHttpPropertiesFunction · 0.90
applyResponseEncodingFunction · 0.85
annotateMethod · 0.65

Tested by

no test coverage detected