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

Function getErrorSchemas

packages/effect/src/http-api/HttpApiEndpoint.ts:419–429  ·  view source on GitHub ↗
(endpoint: Top)

Source from the content-addressed store, hash-verified

417 * @internal
418 */
419export function getErrorSchemas(endpoint: Top): Array<Schema.Top> {
420 const schemas = new Set<Schema.Top>(endpoint.error)
421 const transform = endpoint.disableCodecs ? identity : transformResponseSchema
422 for (const middleware of endpoint.middlewares) {
423 const key = middleware as any as HttpApiMiddleware.AnyService
424 for (const schema of key.error) {
425 schemas.add(transform(schema))
426 }
427 }
428 return Array.from(schemas)
429}
430
431/**
432 * A widened `HttpApiEndpoint` type used when the concrete method, path, schemas,

Callers

nothing calls this directly

Calls 3

fromMethod · 0.80
addMethod · 0.65
transformFunction · 0.50

Tested by

no test coverage detected