MCPcopy
hub / github.com/Effect-TS/effect / Api

Class Api

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

Source from the content-addressed store, hash-verified

502class AnotherApi extends HttpApi.make("another").add(GroupsApi) {}
503
504class Api extends HttpApi.make("api")
505 .addHttpApi(AnotherApi)
506 .add(UsersApi.prefix("/users"))
507 .add(TopLevelApi)
508 .addError(GlobalError, { status: 413 })
509 .annotateContext(OpenApi.annotations({
510 title: "API",
511 summary: "test api summary",
512 transform: (openApiSpec) => ({
513 ...openApiSpec,
514 tags: [...openApiSpec.tags ?? [], {
515 name: "Tag from OpenApi.Transform annotation"
516 }]
517 })
518 }))
519 .annotate(
520 HttpApi.AdditionalSchemas,
521 [
522 Schema.Struct({
523 contentType: Schema.String,
524 length: Schema.Int
525 }).annotations({
526 identifier: "ComponentsSchema"
527 })
528 ]
529 )
530{}
531
532// impl
533

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