Commit graph

12 commits

Author SHA1 Message Date
rimskij
df0143ddcc chore: release v0.2.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 17:48:24 +01:00
rimskij
4984afbff3 docs: add code quality refactoring task document
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 17:45:27 +01:00
rimskij
70fada22d6 refactor: consolidate shared utilities and reduce code duplication
- Extract HTTP_METHODS constant to types.ts (eliminates duplication in 3 files)
- Add DEFAULT_CACHE_MAX_SIZE and DEFAULT_CACHE_TTL_MINUTES constants to cache.ts
- Create schema-utils.ts with getSchemas, findSchema, getSchemaNames, getSchemaCount
- Create spec-guards.ts with isOpenAPIV3, isSwaggerV2, getSpecVersion type guards
- Create tool-response.ts with successResponse, errorResponse helpers
- Update all tool handlers to use response helpers (~50 lines reduced)
- Update parser.ts to use type guards for version detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 17:45:18 +01:00
rimskij
cae5f7fce1 feat: add in-memory LRU cache for parsed specs
Add caching layer to improve performance when repeatedly accessing
the same OpenAPI specs:

- LRU cache with max 10 entries and 15-minute TTL
- Cache key includes mtime for local files (change detection)
- URL normalization for consistent remote spec caching
- noCache parameter on all tools to bypass cache
- Response includes cached:true/false indicator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 17:09:21 +01:00
rimskij
a4fc2df4ea feat: add TypeScript generation options to generate-types tool
Add configurable options for customizing TypeScript output:
- enumAsUnion/enumAsEnum: control enum generation style
- interfacePrefix/interfaceSuffix: naming conventions for interfaces
- indentation: 2 spaces, 4 spaces, or tab

Includes validation for mutually exclusive options and valid
TypeScript identifier prefixes/suffixes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 15:42:39 +01:00
rimskij
1feae7a91d docs: add handoff documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 15:17:11 +01:00
rimskij
7791adc288 docs: update README and CLAUDE.md with new features
- Document broken $ref fallback handling
- Document .NET-style name sanitization for TypeScript
- Add "Tested With" section showing enterprise API support
- Add example output from .NET API
- Update CLAUDE.md with key features section

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 15:15:34 +01:00
rimskij
64f7e40ee2 chore: release v0.1.1 2026-01-12 15:05:20 +01:00
rimskij
c978f9c313 fix: sanitize .NET-style schema names for valid TypeScript
- Handle fully qualified names (Namespace.Type -> Type)
- Handle generics (Type\`1[Inner] -> Type_Inner)
- Preserve original name in JSDoc comment
- Tested with Moravia Symfonie API (185 schemas)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 15:04:00 +01:00
rimskij
409194781e fix: graceful fallback for specs with broken $refs
- parseSpec now tries dereference first, falls back to parse on failure
- Shows warning when spec has broken references
- Tested with Moravia Symfonie API (293 paths, 381 operations)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 14:55:26 +01:00
rimskij
641a9e56dc docs: add comprehensive README and update CLAUDE.md
- Full README with installation, configuration, tool reference
- Usage examples for all 5 tools
- Architecture overview and dependency list
- Updated CLAUDE.md with code patterns and development guide

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 14:41:19 +01:00
rimskij
cc789d3b32 feat: initial MCP server for OpenAPI/Swagger parsing
- Parse and validate OpenAPI 3.x / Swagger 2.0 specs
- Query endpoints by method, path pattern, tag, operationId
- Get component schema details
- Generate TypeScript interfaces from schemas
- Support local files and remote URLs

Tools: parse-spec, validate-spec, query-endpoints, get-schema, generate-types

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 14:33:10 +01:00