feat: interactive spec prompt, URL loading, --split flag, and docs update#1
Merged
feat: interactive spec prompt, URL loading, --split flag, and docs update#1
Conversation
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.
…operationId fallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three new CLI features and updates all documentation to match.
Features
-iis now optional — when omitted, an interactive prompt offers three choices: local file path, direct URL, or auto-discover from a base URLloadSpec()acceptshttp:///https://URLs in addition to local file paths, with JSON/YAML parsing and Swagger 2→3 conversion--splitflag: generates per-tag feature folders — each tag gets its owntypes.ts,hooks.ts,mocks.ts, andindex.tswith a root barrel re-exportsrc/discover.ts): tries well-known API doc paths (/v3/api-docs,/swagger.json,/openapi.json, etc.) against a base URLDocumentation
getting-started,configuration,api-reference,architecture,generated-output,contributing,CLAUDE.md) to reflect new featureswriteGeneratedFilessignature, peer deps (react ^18 || ^19)New files
src/discover.ts— auto-discovery moduletests/discover.test.ts— 7 tests for discoverytests/fixtures/tagged-api.yaml— fixture for split output testsTest Plan
tsc --noEmit)--splitand--no-mockflags