(req: HTTPRequestLike, res: HTTPResponseLike)
| 132 | |
| 133 | @Get("/api/docs") |
| 134 | async handleOpenAPISpec(req: HTTPRequestLike, res: HTTPResponseLike): Promise<void> { |
| 135 | try { |
| 136 | // Use HTTPAPIService's method to get spec from all controllers |
| 137 | const spec = |
| 138 | this.httpAPIService && this.httpAPIService.generateOpenAPISpec |
| 139 | ? this.httpAPIService.generateOpenAPISpec() |
| 140 | : generateOpenAPISpec(this); |
| 141 | |
| 142 | res.statusCode = 200; |
| 143 | res.setHeader("Content-Type", "application/json"); |
| 144 | res.end(JSON.stringify(spec, null, 2)); |
| 145 | } catch (error: unknown) { |
| 146 | tasknotesLogger.error("OpenAPI spec generation error:", { |
| 147 | category: "provider", |
| 148 | operation: "openapi-spec-generation", |
| 149 | error: error, |
| 150 | }); |
| 151 | this.sendResponse(res, 500, this.errorResponse("Failed to generate API specification")); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | @Get("/api/docs/ui") |
| 156 | async handleSwaggerUI(req: HTTPRequestLike, res: HTTPResponseLike): Promise<void> { |
nothing calls this directly
no test coverage detected