vitepress-openapi
Version:
Generate VitePress API Documentation from OpenAPI Specification.
34 lines (33 loc) • 987 B
TypeScript
import type { OpenAPI } from '@scalar/openapi-types';
type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'null';
interface Metadata {
isCircularReference?: boolean;
isAdditionalProperties?: boolean;
isOneOf?: boolean;
isOneOfItem?: boolean;
isConstant?: boolean;
extra?: Record<string, unknown>;
}
interface DocumentationReference {
url?: string;
description?: string;
}
export interface OAProperty {
name: string;
types: JSONSchemaType[];
required: boolean;
examples?: unknown[];
title?: string;
description?: string;
defaultValue?: unknown;
docs?: DocumentationReference;
constraints?: Record<string, unknown>;
properties?: OAProperty[];
enum?: unknown[];
subtype?: JSONSchemaType;
subexamples?: unknown[];
nullable?: boolean;
meta?: Metadata;
}
export declare function getSchemaUi(jsonSchema: OpenAPI.SchemaObject): OAProperty | OAProperty[];
export {};