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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user