docs: update api-reference project for v2 (#7307)

* remove everything v1 and make v2 default

* move main v2 rewrites to book

* move rewrites to book + other fixes
This commit is contained in:
Shahed Nasser
2024-05-16 09:02:35 +02:00
committed by GitHub
parent 9b1998b9b2
commit 22f30f54fd
2148 changed files with 8965 additions and 140283 deletions
@@ -1,7 +1,6 @@
import { existsSync, readFileSync } from "fs"
import { NextResponse } from "next/server"
import path from "path"
import { Version } from "../../../../types/openapi"
type DownloadParams = {
params: {
@@ -10,16 +9,8 @@ type DownloadParams = {
}
export function GET(request: Request, { params }: DownloadParams) {
const { searchParams } = new URL(request.url)
const { area } = params
const version =
process.env.NEXT_PUBLIC_VERSIONING === "true"
? (searchParams.get("version") as Version) || "1"
: "1"
const filePath = path.join(
process.cwd(),
`${version === "1" ? "specs" : "specs-v2"}/${area}/openapi.full.yaml`
)
const filePath = path.join(process.cwd(), "specs", area, "openapi.full.yaml")
if (!existsSync(filePath)) {
return new NextResponse(null, {