egyjs Swagger Generator is a powerful, lightweight tool for generating OpenAPI (Swagger) documentation with an easy-to-use UI form. Built with Alpine.js, it allows developers to quickly create API specifications without the need for complex setups or coding.
- User-Friendly Interface: Generate Swagger documentation using an interactive UI form.
- Dynamic Schema Generation: Automatically generate JSON schemas from form inputs, including request bodies and response examples.
- Multiple Content Types: Supports JSON, XML, or both content types for API responses.
- Live Schema Generation: Instant live updates for Swagger JSON while editing inputs.
- Security: Built-in support for security schemes like Bearer Authentication.
- Node.js (>= 12.0.0)
- npm or yarn
Clone the repository:
$ git clone https://github.com/egyjs/swagger-generator.git
$ cd swagger-generatorInstall dependencies:
$ npm installTo run the Swagger Generator app locally, use:
$ npm run devThen open your browser at http://localhost:3000 to start using the Swagger Generator UI.
- Fill out the form to define your API title, version, description, and URLs.
- Add API paths and endpoints with methods such as GET, POST, PUT, DELETE.
- Provide detailed information like request bodies and responses.
- The generated Swagger JSON schema will automatically appear on the side panel.
Below is a sample of the generated Swagger output:
{
"openapi": "3.0.1",
"info": {
"title": "Example API",
"description": "An example API for demonstration purposes",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.example.com/v1/"
}
],
"paths": {
"/example": {
"get": {
"tags": ["Example"],
"summary": "Get example details",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"key": {
"type": "string",
"example": "value"
}
}
}
}
}
}
}
}
}
}
}- Simplifies API Documentation: No coding needed to create robust OpenAPI documentation.
- SEO Optimized: Optimize your project's visibility by using a structured, comprehensive approach.
- Lightweight & Easy to Use: Built with Alpine.js, making it incredibly fast and light for web usage.
If you have any questions or run into any issues, feel free to reach out:
- Email: el3zahaby@gmail.com
- LinkedIn: Abdulrahman El Zahaby
Contributions are welcome! If you want to contribute to the development of this project, please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Swagger, OpenAPI, API Documentation, egyjs, Alpine.js, Swagger Generator, OpenAPI Generator, API, Documentation, REST API
