@scalar/api-client
Version:
the open source API testing client
23 lines • 989 B
TypeScript
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
/**
* Server processing options containing base URLs for resolving relative server URLs.
*/
type ServerProcessingOptions = {
baseServerUrl?: string;
documentUrl?: string;
};
/**
* Retrieves and processes servers from an OpenAPI document.
*
* This function handles several scenarios:
* 1. No servers provided - creates a default server from document URL or fallback
* 2. Invalid server configurations - filters them out with warnings
* 3. Relative URLs - resolves them to absolute URLs using available base URLs
*
* @param servers - Array of OpenAPI server objects from the document
* @param options - Configuration options for server processing
* @returns Array of validated Server entities
*/
export declare function getServers(servers: ServerObject[] | undefined, options?: ServerProcessingOptions): ServerObject[];
export {};
//# sourceMappingURL=get-servers.d.ts.map