A comprehensive full-stack MERN application that streamlines the process of generating, testing, and validating OpenAPI client stubs across multiple programming languages. Built for developers who need to quickly create and test API clients from OpenAPI specifications.
This application provides an intuitive 3-step workflow that transforms OpenAPI specifications into working client libraries with integrated testing capabilities. Whether you're working with REST APIs, need to generate client SDKs, or want to validate your OpenAPI specifications, this tool provides a complete solution.
π Streamlined 3-Step Workflow:
- Upload & Validate - Drag-and-drop support for JSON/YAML OpenAPI specs with real-time validation
- Language Selection - Choose from 10+ programming languages with visual language cards
- Generate & Test - Create client code, test functionality, and download complete projects
β¨ Professional User Interface:
- Salesforce Lightning Design System (SLDS) styling with authentic brand colors
- Modern UI with professional gradients and animations
- Fully responsive design optimized for desktop and mobile
- Interactive progress indicator with step-by-step guidance
- Real-time feedback with comprehensive error handling and success notifications
π Enterprise-Grade Backend:
- Express.js REST API with comprehensive endpoint coverage
- OpenAPI Generator CLI JAR integration with automatic management and caching
- Web-based interface for the OpenAPI Generator command-line tool
- Salesforce API integration for real-world testing scenarios
- Frontend: React 18 + TypeScript, Axios, Lucide Icons
- Backend: Node.js + Express.js, Multer, YAML.js
- Code Generation: OpenAPI Generator CLI (Java-based)
- Styling: Custom CSS with modern design principles
Client Generation: All languages below
- Java
- JavaScript (Node.js)
- TypeScript (Node.js)
- Python
- C#
- Go
- PHP
- Ruby
- Swift
- Kotlin
**API Testing within the web app supported through JavaScript
- Node.js (v16 or higher) - Download here
- Java Runtime Environment (JRE) - Required for OpenAPI Generator CLI
- Git - For version control
-
Clone the repository:
git clone https://github.com/riyasurisalesforce/openapi-client-generation.git cd openapi-client-generation -
Install all dependencies:
npm run install-all
This command automatically installs dependencies for the root project, server, and client applications.
-
Start the development environment:
npm run dev
This launches both the backend API server (port 5000) and React frontend (port 3000) concurrently.
-
Access the application: Open your browser and navigate to
http://localhost:3000
For full API testing functionality with JavaScript clients:
- Generate a JavaScript client using the application
- Download the generated ZIP file
- Extract the
openapi-javascriptfolder to the project root - Build the generated client:
This creates the required
cd openapi-javascript npm installdist/folder with compiled JavaScript files. - The API testing features will now be fully functional
Important: Generated JavaScript clients must be built before testing. The build step compiles ES6+ source code to Node.js compatible JavaScript and creates the dist/index.js file that the server requires.
Note: The openapi-javascript folder is excluded from version control as it contains generated code specific to your OpenAPI specifications.
- Drag and Drop: Simply drag your OpenAPI file (JSON or YAML) onto the upload area
- Click to Browse: Use the file browser to select your specification file
- Real-time Validation: The system automatically validates your spec and displays API information
- Supported Formats: OpenAPI 3.0+ in JSON or YAML format
- Visual Selection: Browse through language cards showing popular programming languages
- 10+ Languages Supported: Java, JavaScript, TypeScript, Python, C#, Go, PHP, Ruby, Swift, Kotlin
- Clear Identification: Each card displays the full language name and icon for easy selection
- One-Click Generation: Click "Generate Client Code" to create your client library
- File Explorer: Browse through all generated files in an interactive tree view
- Live Testing: Use "Test Generated Code" to compile and execute your client (where supported)
- Complete Download: Download the entire generated project as a ZIP file for immediate use
- Salesforce Integration: Test your generated clients against real Salesforce APIs
- Code Execution: Validate your generated clients work correctly before downloading
- Project Management: Organized file structure with all necessary dependencies included
The project includes sample-petstore-api.json - a complete OpenAPI 3.0 specification for testing. This demonstrates:
- Multiple HTTP methods (GET, POST, DELETE)
- Path parameters and request bodies
- Complex schema definitions with references
- Proper error response handling
openapi-client-generation/
βββ client/ # React Frontend Application
β βββ src/
β β βββ App.tsx # Main application component with 3-step workflow
β β βββ App.css # SLDS styling with modern theme
β β βββ index.tsx # Application entry point
β βββ public/
β β βββ index.html # HTML template with updated title
β βββ package.json # Frontend dependencies and scripts
β βββ tsconfig.json # TypeScript configuration
βββ server/ # Express Backend API
β βββ index.js # Main server with all API endpoints
β βββ TestClient.java # Java test client for API validation
β βββ openapi-generator-cli.jar # OpenAPI Generator CLI tool
β βββ package.json # Backend dependencies
βββ uploads/ # Uploaded OpenAPI specifications
βββ generated/ # Generated client projects (organized by timestamp)
βββ openapi-javascript/ # Generated JS client for API testing (gitignored)
βββ extracted/ # Temporary extraction directory
βββ sample-petstore-api.json # Sample OpenAPI spec for testing
βββ demo.html # Demonstration page
βββ package.json # Root package with development scripts
βββ LICENSE # MIT license
βββ README.md # This documentation
client/: React TypeScript frontend with modern UI/UXserver/: Node.js Express backend with OpenAPI generation capabilitiesgenerated/: Time-stamped directories containing generated client projectsuploads/: Temporary storage for uploaded OpenAPI specification filesopenapi-javascript/: Auto-generated JavaScript client for live API testing
# Start both frontend and backend
npm run dev
# Start only backend (port 5000)
npm run server
# Start only frontend (port 3000)
npm run client
# Build frontend for production
npm run build
# Install all dependencies
npm run install-all- Multer Integration: Secure file upload with type validation
- OpenAPI Generator Management: Automatic JAR download and caching
- Process Execution: Safe code compilation and execution with timeouts
- Archive Creation: ZIP file generation for project downloads
- TypeScript: Full type safety with comprehensive interfaces
- Modern React: Functional components with hooks
- Responsive Design: Mobile-first approach with CSS Grid/Flexbox
- Error Handling: Comprehensive user feedback system
- File type validation for uploads
- Execution timeouts prevent runaway processes
- Input sanitization and validation
Port conflicts: Modify ports in server/index.js (backend) or client package.json (frontend)
Generation failures: Ensure the OpenAPI spec is valid JSON/YAML and follows OpenAPI 3.0+ format
API testing setup:
- Generate a JavaScript client and download the ZIP file
- Unzip the downloaded file and upload it to your local directory structure
- Build the client by running
cd openapi-javascript && npm install
This application includes specialized Salesforce API integration capabilities:
- Real-world Testing: Test generated clients against actual Salesforce org APIs
- Authentication: Support for Salesforce OAuth and session-based authentication
- Metadata Access: Examples showing how to access Salesforce object metadata
MIT License - see LICENSE file for details.
For questions, issues, or contributions, please use the GitHub repository's issue tracker.