MCPcopy Index your code
hub / github.com/Effect-TS/effect / processResponseMap

Function processResponseMap

packages/platform/src/OpenApi.ts:337–361  ·  view source on GitHub ↗
(
        map: ReadonlyMap<number, {
          readonly ast: Option.Option<AST.AST>
          readonly description: Option.Option<string>
        }>,
        defaultDescription: () => string
      )

Source from the content-addressed store, hash-verified

335 }
336
337 function processResponseMap(
338 map: ReadonlyMap<number, {
339 readonly ast: Option.Option<AST.AST>
340 readonly description: Option.Option<string>
341 }>,
342 defaultDescription: () => string
343 ) {
344 for (const [status, { ast, description }] of map) {
345 if (op.responses[status]) continue
346 op.responses[status] = {
347 description: Option.getOrElse(description, defaultDescription)
348 }
349 ast.pipe(
350 Option.filter((ast) => !HttpApiSchema.getEmptyDecodeable(ast)),
351 Option.map((ast) => {
352 const encoding = HttpApiSchema.getEncoding(ast)
353 op.responses[status].content = {
354 [encoding.contentType]: {
355 schema: processAST(ast)
356 }
357 }
358 })
359 )
360 }
361 }
362
363 function processParameters(schema: Option.Option<Schema.Schema.All>, i: OpenAPISpecParameter["in"]) {
364 if (Option.isSome(schema)) {

Callers 1

onEndpointFunction · 0.85

Calls 3

processASTFunction · 0.85
pipeMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected