Skip to main content
Glama
kadykov

OpenAPI Schema Explorer

config.test.ts1.33 kB
import { loadConfig } from '../../../src/config.js'; describe('Config', () => { describe('loadConfig', () => { it('returns valid configuration with default format when only path is provided', () => { const config = loadConfig('/path/to/spec.json'); expect(config).toEqual({ specPath: '/path/to/spec.json', outputFormat: 'json', }); }); it('returns valid configuration when path and format are provided', () => { const config = loadConfig('/path/to/spec.json', { outputFormat: 'yaml' }); expect(config).toEqual({ specPath: '/path/to/spec.json', outputFormat: 'yaml', }); }); it('throws error when invalid format is provided', () => { expect(() => loadConfig('/path/to/spec.json', { outputFormat: 'invalid' })).toThrow( 'Invalid output format. Supported formats: json, yaml' ); }); it('throws error when path is not provided', () => { expect(() => loadConfig()).toThrow( 'OpenAPI spec path is required. Usage: npx mcp-openapi-schema-explorer <path-to-spec>' ); }); it('throws error when path is empty string', () => { expect(() => loadConfig('')).toThrow( 'OpenAPI spec path is required. Usage: npx mcp-openapi-schema-explorer <path-to-spec>' ); }); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kadykov/mcp-openapi-schema-explorer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server