feat(docs): remove old json api docs

This commit is contained in:
perf3ct 2025-08-20 17:36:22 +00:00
parent 05c73011f5
commit 53ed510c92
No known key found for this signature in database
GPG key ID: 569C4EEC436F5232
2 changed files with 3 additions and 12 deletions

File diff suppressed because one or more lines are too long

View file

@ -3,22 +3,14 @@ import swaggerUi from "swagger-ui-express";
import { join } from "path";
import yaml from "js-yaml";
import type { JsonObject } from "swagger-ui-express";
import { readFileSync, existsSync } from "fs";
import { readFileSync } from "fs";
import { RESOURCE_DIR } from "../services/resource_dir";
export default function register(app: Application) {
const etapiDocument = yaml.load(readFileSync(join(RESOURCE_DIR, "etapi.openapi.yaml"), "utf8")) as JsonObject;
// Load the comprehensive API documentation (YAML) if available, otherwise fall back to JSON
const apiYamlPath = join(RESOURCE_DIR, "api-openapi.yaml");
const apiJsonPath = join(RESOURCE_DIR, "openapi.json");
let apiDocument: JsonObject;
if (existsSync(apiYamlPath)) {
apiDocument = yaml.load(readFileSync(apiYamlPath, "utf8")) as JsonObject;
} else {
apiDocument = JSON.parse(readFileSync(apiJsonPath, "utf-8"));
}
// Load the comprehensive API documentation from YAML
const apiDocument = yaml.load(readFileSync(join(RESOURCE_DIR, "api-openapi.yaml"), "utf8")) as JsonObject;
app.use(
"/etapi/docs/",