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 10:02:35 +03:00
committed by GitHub
parent 9b1998b9b2
commit 22f30f54fd
2148 changed files with 8965 additions and 140283 deletions

View File

@@ -1,5 +1,5 @@
import { NextResponse } from "next/server"
import { SchemaObject, Version } from "../../../types/openapi"
import { SchemaObject } from "../../../types/openapi"
import path from "path"
import { existsSync, promises as fs } from "fs"
import { parseDocument } from "yaml"
@@ -8,7 +8,6 @@ export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
let name = searchParams.get("name")
const area = searchParams.get("area")
const version = (searchParams.get("version") as Version) || "1"
if (!name) {
return NextResponse.json(
@@ -40,7 +39,7 @@ export async function GET(request: Request) {
const schemaPath = path.join(
process.cwd(),
version === "1" ? "specs" : "specs-v2",
"specs",
area,
"components",
"schemas",