UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

34 lines 1.42 kB
import type { OpenAPI, OpenAPIV3_1 } from '@scalar/openapi-types'; import type { OperationObject, ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'; /** * Formats a property object into a string. */ export declare function formatProperty(key: string, obj: OpenAPIV3_1.SchemaObject): string; /** * Extracts the request body from an operation. */ export declare function extractRequestBody(operation: OperationObject): string[] | boolean; /** * Deep merge for objects */ export declare function deepMerge(source: Record<any, any>, target: Record<any, any>): Record<any, any>; /** * Creates an empty specification object. * The returning object has the same structure as a valid OpenAPI specification, but everything is empty. */ export declare function createEmptySpecification(partialSpecification?: Partial<OpenAPI.Document>): OpenAPI.Document; export type ParameterMap = { path: ParameterObject[]; query: ParameterObject[]; header: ParameterObject[]; cookie: ParameterObject[]; body: ParameterObject[]; formData: ParameterObject[]; }; /** * This function creates a parameter map from an Operation Object, that's easier to consume. * * TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it? */ export declare function createParameterMap(operation: OperationObject): ParameterMap; //# sourceMappingURL=openapi.d.ts.map