MCPcopy Create free account
hub / github.com/ReAPI-com/mcp-openapi / findSchemaByName

Method findSchemaByName

src/core/SpecService.ts:417–437  ·  view source on GitHub ↗
(
    specId: string,
    schemaName: string
  )

Source from the content-addressed store, hash-verified

415 }
416
417 async findSchemaByName(
418 specId: string,
419 schemaName: string
420 ): Promise<LoadSchemaResult | null> {
421 const spec = this.specs[specId];
422 if (!spec) {
423 return null;
424 }
425 const schema = spec.components?.schemas?.[schemaName];
426 if (!schema) {
427 return null;
428 }
429
430 // all references must have been dereferenced
431 return {
432 name: schemaName,
433 description: schema["description"],
434 schema: schema as OpenAPIV3.SchemaObject,
435 uri: `apis://${specId}/schemas/${schemaName}`,
436 };
437 }
438
439 async findOperationById(
440 specId: string,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected