A web-based tool to extract and export sections from Swagger/OpenAPI JSON files. Select specific API tags and export endpoints with their schemas in JSON or TOON format (optimized for LLM prompts).
- File Upload: Drag & drop or click to upload Swagger/OpenAPI JSON files
- Tag Selection: Interactive table to select specific API tags
- Endpoint Preview: View selected endpoints with methods, paths, and descriptions
- Multiple Export Formats:
- JSON: Standard JSON output with resolved schemas
- TOON: Text-optimized format for LLM context (reduced token usage)
- Dark Mode: System-aware theme with manual toggle
- Schema Resolution: Automatically resolves
$refreferences
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS 4
- UI Components: shadcn/ui
- Theme: next-themes
- Node.js 18+
- npm, yarn, or pnpm
# Clone the repository
git clone https://github.com/hnKatze/swagger-extractor.git
cd swagger-extractor
# Install dependencies
npm install
# Start development server
npm run devOpen http://localhost:3000 in your browser.
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint- Upload your Swagger/OpenAPI JSON file
- Select the API tags you want to extract
- Preview the endpoints that will be included
- Export in your preferred format (JSON or TOON)
A standalone Python CLI tool is also available for command-line usage:
python swagger_extractor.py <swagger-file> [output-file]Dependencies: rich, InquirerPy
├── app/ # Next.js App Router
│ ├── layout.tsx # Root layout with providers
│ ├── page.tsx # Home page
│ └── globals.css # Global styles & CSS variables
├── components/
│ ├── swagger-extractor/ # Main feature components
│ ├── providers/ # Context providers
│ ├── ui/ # shadcn/ui components
│ └── mode-toggle.tsx # Theme toggle
├── lib/
│ ├── swagger/ # Swagger parsing utilities
│ ├── formatters/ # Output formatters
│ └── types/ # TypeScript types
└── swagger_extractor.py # Python CLI tool
MIT License - see LICENSE for details.