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,15 +1,14 @@
"use client"
import { useMemo } from "react"
import { ExampleObject, SchemaObject } from "../types/openapi"
import { OpenAPI } from "types"
import type { JSONSchema7 } from "json-schema"
import stringify from "json-stringify-pretty-compact"
import { sample } from "openapi-sampler"
import { OpenAPIV3 } from "openapi-types"
type Options = {
schema?: SchemaObject
schemaExamples?: OpenAPIV3.ExampleObject
schema?: OpenAPI.SchemaObject
schemaExamples?: OpenAPI.OpenAPIV3.ExampleObject
schemaExample?: any
options?: {
skipNonRequired?: boolean
@@ -24,7 +23,7 @@ const useSchemaExample = ({
}: Options) => {
const { skipNonRequired = true } = options
const examples = useMemo(() => {
const tempExamples: ExampleObject[] = []
const tempExamples: OpenAPI.ExampleObject[] = []
if (!schema) {
return tempExamples