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
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server"
import path from "path"
import OpenAPIParser from "@readme/openapi-parser"
import getPathsOfTag from "@/utils/get-paths-of-tag"
import type { ExpandedDocument } from "@/types/openapi"
import type { OpenAPI } from "types"
export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
@@ -21,7 +21,7 @@ export async function GET(request: Request) {
}
const baseSpecs = (await OpenAPIParser.parse(
path.join(process.cwd(), "specs", area, "openapi.yaml")
)) as ExpandedDocument
)) as OpenAPI.ExpandedDocument
if (expand) {
const paths = await getPathsOfTag(expand, area)