docs: add prepare script to generate sidebar (#11894)

This commit is contained in:
Shahed Nasser
2025-03-18 17:37:51 +02:00
committed by GitHub
parent eb2aa8da3c
commit 9ead47c51e
72 changed files with 1709 additions and 295 deletions
@@ -1,12 +1,12 @@
import { promises as fs } from "fs"
import { parseDocument } from "yaml"
import { SchemaObject } from "../types/openapi"
import { OpenAPI } from "types"
import dereference from "./dereference"
import { unstable_cache } from "next/cache"
async function getSchemaContent_(schemaPath: string, baseSchemasPath: string) {
const schemaContent = await fs.readFile(schemaPath, "utf-8")
const schema = parseDocument(schemaContent).toJS() as SchemaObject
const schema = parseDocument(schemaContent).toJS() as OpenAPI.SchemaObject
// resolve references in schema
const dereferencedDocument = await dereference({