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

Function applyResponseEncoding

packages/effect/src/http-api/HttpApiEndpoint.ts:1732–1742  ·  view source on GitHub ↗
(schema: Schema.Top, encoding: HttpApiSchema.ResponseEncoding)

Source from the content-addressed store, hash-verified

1730}
1731
1732function applyResponseEncoding(schema: Schema.Top, encoding: HttpApiSchema.ResponseEncoding): Schema.Top {
1733 switch (encoding._tag) {
1734 case "Json":
1735 return Schema.toCodecJson(schema)
1736 case "FormUrlEncoded":
1737 return Schema.toCodecStringTree(schema)
1738 case "Text":
1739 case "Uint8Array":
1740 return schema
1741 }
1742}
1743
1744function transformPayload(schema: Schema.Top, method: HttpMethod): Schema.Top {
1745 if (!hasBody(method)) return toCodecHttpProperties(schema)

Callers 2

HttpApiEndpoint.tsFile · 0.85
transformResponseFunction · 0.85

Calls 2

toCodecJsonMethod · 0.65
toCodecStringTreeMethod · 0.65

Tested by

no test coverage detected