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

Function applyStatus

packages/tools/openapi-generator/src/HttpApiTransformer.ts:525–530  ·  view source on GitHub ↗
(schema: string, status: number, target: "success" | "error")

Source from the content-addressed store, hash-verified

523}
524
525const applyStatus = (schema: string, status: number, target: "success" | "error"): string => {
526 if ((target === "success" && status === 200) || (target === "error" && status === 500)) {
527 return schema
528 }
529 return `${schema}.pipe(HttpApiSchema.status(${status}))`
530}
531
532const methodSupportsBody = (method: ParsedOperation["method"]): boolean =>
533 method !== "get" && method !== "head" && method !== "options" && method !== "trace"

Callers 1

renderResponseSetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected