()
| 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"); |