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

Class Api

packages/platform-node/test/HttpApi.test.ts:566–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564class AnotherApi extends HttpApi.make("another").add(GroupsApi) {}
565
566class Api extends HttpApi.make("api")
567 .addHttpApi(AnotherApi)
568 .add(UsersApi.prefix("/users"))
569 .add(TopLevelApi)
570 .addError(GlobalError, { status: 413 })
571 .annotateContext(OpenApi.annotations({
572 title: "API",
573 summary: "test api summary",
574 transform: (openApiSpec) => ({
575 ...openApiSpec,
576 tags: [...openApiSpec.tags ?? [], {
577 name: "Tag from OpenApi.Transform annotation"
578 }]
579 })
580 }))
581 .annotate(
582 HttpApi.AdditionalSchemas,
583 [
584 Schema.Struct({
585 contentType: Schema.String,
586 length: Schema.Int
587 }).annotations({
588 identifier: "ComponentsSchema"
589 })
590 ]
591 )
592{}
593
594// impl
595

Callers

nothing calls this directly

Calls 8

addHttpApiMethod · 0.80
annotateMethod · 0.65
annotateContextMethod · 0.65
addErrorMethod · 0.65
addMethod · 0.65
makeMethod · 0.65
prefixMethod · 0.65
annotationsMethod · 0.65

Tested by

no test coverage detected