@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
20 lines • 870 B
TypeScript
import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
import type { ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/reference';
/**
* Extract schema name from various schema formats
*
* Handles $ref, title, name, type, and schema dictionary lookup
*/
export declare const getModelNameFromSchema: (schemaOrRef: SchemaObject | ReferenceType<SchemaObject>) => string | null;
/**
* Format the type and model name for display
*/
export declare const formatTypeWithModel: (type: Extract<SchemaObject, {
type: any;
}>["type"], modelName: string) => string;
/**
* Get the model name for a schema property
* e.g. User | Admin | array of User | array of Admin
*/
export declare const getModelName: (value: SchemaObject, hideModelNames?: boolean) => string | null;
//# sourceMappingURL=schema-name.d.ts.map