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

Method loadExistingCatalog

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

Source from the content-addressed store, hash-verified

106 }
107
108 private async loadExistingCatalog(): Promise<boolean> {
109 try {
110 this.logger.debug("Loading existing catalog");
111 this.catalog = await this.loadSpecCatalog();
112 const specs = await Promise.all(
113 this.catalog.map((spec) => this.loadSpec(spec.uri.specId))
114 );
115 specs.forEach((spec, index) => {
116 const specId = this.catalog[index].uri.specId;
117 this.specs[specId] = spec;
118 this.specCache.set(specId, spec);
119 });
120 this.logger.info("Successfully loaded existing catalog");
121 return true;
122 } catch (error) {
123 this.logger.warn({ error }, "Failed to load existing catalog");
124 this.resetState();
125 return false;
126 }
127 }
128
129 public async initialize() {
130 this.logger.debug("Initializing FileSystemSpecService");

Callers 1

initializeMethod · 0.95

Calls 7

loadSpecCatalogMethod · 0.95
loadSpecMethod · 0.95
resetStateMethod · 0.95
setMethod · 0.80
debugMethod · 0.65
infoMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected