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

Function process

packages/effect/src/unstable/httpapi/OpenApi.ts:743–764  ·  view source on GitHub ↗
(schema: Schema.Constraint)

Source from the content-addressed store, hash-verified

741 return map
742
743 function process(schema: Schema.Constraint) {
744 const annotation = HttpApiSchema.getWithHeadersAnnotation(schema.ast)
745 const body = HttpApiSchema.isWithHeaders(schema) ? schema.schema : annotation?.body ?? schema
746 const headers = HttpApiSchema.isWithHeaders(schema) ? schema.headers : annotation?.headersCodec
747 const status = getStatus(schema)
748 const ast = body.ast
749 if (HttpApiSchema.isStreamSchema(body)) {
750 addStreamContent(body, status)
751 } else if (HttpApiSchema.isNoContent(ast)) {
752 addNoContent(status, getDescription(schema.ast) ?? getDescription(ast) ?? "<No Content>")
753 } else {
754 addContent(
755 body,
756 status,
757 HttpApiSchema.getResponseEncodingSchema(schema),
758 getDescription(schema.ast) ?? getDescription(ast)
759 )
760 }
761 if (headers !== undefined) {
762 map.get(status)!.headers.push(headers)
763 }
764 }
765
766 function addNoContent(status: number, description: string) {
767 const statusMap = map.get(status)

Callers

nothing calls this directly

Calls 7

addStreamContentFunction · 0.85
addNoContentFunction · 0.85
getDescriptionFunction · 0.85
addContentFunction · 0.85
pushMethod · 0.80
getMethod · 0.65
getStatusFunction · 0.50

Tested by

no test coverage detected