Skip to content

feat: interactive spec prompt, URL loading, --split flag, and docs update#1

Merged
ducdmdev merged 13 commits intomainfrom
docs/accuracy-update
Feb 26, 2026
Merged

feat: interactive spec prompt, URL loading, --split flag, and docs update#1
ducdmdev merged 13 commits intomainfrom
docs/accuracy-update

Conversation

@ducdmdev
Copy link
Owner

@ducdmdev ducdmdev commented Feb 26, 2026

Summary

Adds three new CLI features and updates all documentation to match.

Features

  • Interactive spec prompt: -i is now optional — when omitted, an interactive prompt offers three choices: local file path, direct URL, or auto-discover from a base URL
  • URL spec loading: loadSpec() accepts http:///https:// URLs in addition to local file paths, with JSON/YAML parsing and Swagger 2→3 conversion
  • --split flag: generates per-tag feature folders — each tag gets its own types.ts, hooks.ts, mocks.ts, and index.ts with a root barrel re-export
  • Auto-discovery (src/discover.ts): tries well-known API doc paths (/v3/api-docs, /swagger.json, /openapi.json, etc.) against a base URL

Documentation

  • Updated all 7 doc files (getting-started, configuration, api-reference, architecture, generated-output, contributing, CLAUDE.md) to reflect new features
  • Fixed stale claims: operationId fallback description, writeGeneratedFiles signature, peer deps (react ^18 || ^19)
  • Updated test count from 31 → 56 tests across 11 files

New files

  • src/discover.ts — auto-discovery module
  • tests/discover.test.ts — 7 tests for discovery
  • tests/fixtures/tagged-api.yaml — fixture for split output tests

Test Plan

  • All 56 tests pass across 11 files
  • Typecheck clean (tsc --noEmit)
  • No stale doc references (grep verified)
  • E2E tests cover --split and --no-mock flags

loadSpec now accepts http:// and https:// URLs in addition to local
file paths. Includes JSON/YAML parsing and Swagger 2→3 conversion
for remote specs.
When --split is enabled, output is grouped into subdirectories by
the first OpenAPI tag on each operation. Each folder gets its own
types, hooks, mocks, and index files with a root barrel re-export.
Adds 2 edge-case tests from code review suggestions: discovering
specs served as YAML and skipping 200 responses with non-spec
content. Also tracks the interactive spec source design and plan.
@ducdmdev ducdmdev changed the title docs: fix stale claims and add missing features across all docs feat: interactive spec prompt, URL loading, --split flag, and docs update Feb 26, 2026
@ducdmdev ducdmdev merged commit cd6e022 into main Feb 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant