mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
feat(api-docs): Redoc-rendered /api/docs + consolidate OpenAPI spec to docs/openapi.yaml (#4781)
Redoc /api/docs + OpenAPI spec consolidated to docs/openapi.yaml (canonical 201-path complete spec; old path → legacy fallback). All refs/gates/tests/CI updated. Integrated into release/v3.8.35.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* gen-openapi-module.mjs — build helper that reads docs/reference/openapi.yaml,
|
||||
* gen-openapi-module.mjs — build helper that reads docs/openapi.yaml,
|
||||
* flattens the path/method matrix, and emits
|
||||
* src/app/docs/lib/openapi.generated.ts so the Api Explorer client can
|
||||
* iterate endpoints without parsing YAML at runtime.
|
||||
@@ -23,7 +23,7 @@ import * as yaml from "js-yaml";
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const ROOT = path.resolve(__dirname, "..", "..");
|
||||
const OPENAPI_PATH = path.join(ROOT, "docs", "reference", "openapi.yaml");
|
||||
const OPENAPI_PATH = path.join(ROOT, "docs", "openapi.yaml");
|
||||
const OUT_PATH = path.join(ROOT, "src", "app", "docs", "lib", "openapi.generated.ts");
|
||||
|
||||
const HTTP_METHODS = ["get", "post", "put", "delete", "patch", "options", "head"];
|
||||
@@ -108,7 +108,7 @@ async function main() {
|
||||
const header = `// AUTO-GENERATED by scripts/docs/gen-openapi-module.mjs — DO NOT EDIT MANUALLY
|
||||
// Regenerate with: node scripts/docs/gen-openapi-module.mjs
|
||||
//
|
||||
// Source of truth: docs/reference/openapi.yaml
|
||||
// Source of truth: docs/openapi.yaml
|
||||
//
|
||||
// The Api Explorer consumes \`OPENAPI_ENDPOINTS\`; the spec metadata
|
||||
// (\`OPENAPI_VERSION\`, \`OPENAPI_TITLE\`) is surfaced in the page header.
|
||||
|
||||
Reference in New Issue
Block a user