MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveSpecForInput

Function resolveSpecForInput

packages/plugins/openapi/src/sdk/plugin.ts:569–584  ·  view source on GitHub ↗
(
    spec: OpenApiSpecInput,
    httpClientLayer: Layer.Layer<HttpClient.HttpClient, never, never>,
  )

Source from the content-addressed store, hash-verified

567
568export const openApiPlugin = definePlugin((options?: OpenApiPluginOptions) => {
569 const resolveSpecForInput = (
570 spec: OpenApiSpecInput,
571 httpClientLayer: Layer.Layer<HttpClient.HttpClient, never, never>,
572 ): Effect.Effect<
573 {
574 readonly specText: string;
575 },
576 OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError
577 > =>
578 Effect.gen(function* () {
579 if (spec.kind === "url") {
580 const specText = yield* resolveSpecText(spec.url).pipe(Effect.provide(httpClientLayer));
581 return { specText };
582 }
583 return { specText: spec.value };
584 });
585
586 return {
587 id: "openapi" as const,

Callers 2

addSpecFunction · 0.85
updateSpecFunction · 0.85

Calls 1

resolveSpecTextFunction · 0.90

Tested by

no test coverage detected