@scalar/api-client
Version:
the open source API testing client
23 lines • 989 B
TypeScript
/**
* Represents parsed details from an OpenAPI or Swagger specification.
* Used to display information about imported API descriptions in the command palette.
*/
export type OpenApiDocumentDetails = {
/** The API specification version (e.g., "OpenAPI 3.1.0" or "Swagger 2.0"). */
version: string;
/** The format of the specification document. */
type: 'json' | 'yaml';
/** The API title extracted from the info object, if available. */
title: string | undefined;
};
/**
* Extracts OpenAPI or Swagger specification details from a string.
* Attempts to parse as JSON first, then YAML if JSON parsing fails.
*
* Returns undefined if:
* - Input is null, empty, or a URL
* - Input is not a valid JSON or YAML document
* - Document does not contain OpenAPI or Swagger version information
*/
export declare const getOpenApiDocumentDetails: (input: string | null) => OpenApiDocumentDetails | undefined;
//# sourceMappingURL=get-openapi-document-details.d.ts.map