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

Method initialize

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

Source from the content-addressed store, hash-verified

127 }
128
129 public async initialize() {
130 this.logger.debug("Initializing FileSystemSpecService");
131 try {
132 await this.ensureDirectories();
133 await this.loadExistingCatalog();
134 await this.scanAndSave(this.folderPath);
135 this.logger.info("Successfully initialized FileSystemSpecService");
136 } catch (error) {
137 this.logger.error(
138 { error },
139 "Failed to initialize FileSystemSpecService"
140 );
141 this.resetState();
142 throw new SpecServiceError(
143 "Failed to initialize FileSystemSpecService",
144 "INIT_ERROR",
145 error instanceof Error ? error : new Error(String(error))
146 );
147 }
148 }
149
150 async scanAndSave(folderPath: string): Promise<void> {
151 this.logger.debug({ folderPath }, "Starting scan and persist operation");

Callers 1

refreshMethod · 0.95

Calls 7

ensureDirectoriesMethod · 0.95
loadExistingCatalogMethod · 0.95
scanAndSaveMethod · 0.95
resetStateMethod · 0.95
debugMethod · 0.65
infoMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected