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

Method loadSpecCatalog

src/core/SpecService.ts:273–284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271 }
272
273 async loadSpecCatalog(): Promise<SpecCatalogEntry[]> {
274 try {
275 const catalogPath = path.join(this.catalogPath, "catalog.json");
276 const catalog = await fs.readFile(catalogPath, "utf-8");
277 return JSON.parse(catalog);
278 } catch (error) {
279 if ((error as NodeJS.ErrnoException).code === "ENOENT") {
280 return [];
281 }
282 throw error;
283 }
284 }
285
286 async loadSpec(specId: string): Promise<OpenAPIV3.Document> {
287 this.logger.debug({ specId }, "Loading specification");

Callers 1

loadExistingCatalogMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected