{"id":24203289,"url":"https://github.com/tobyqin/swagger-master","last_synced_at":"2025-12-31T14:39:41.467Z","repository":{"id":272145593,"uuid":"915657194","full_name":"tobyqin/swagger-master","owner":"tobyqin","description":"A lightweight, single-file Swagger UI manager for multiple OpenAPI specifications","archived":false,"fork":false,"pushed_at":"2025-01-23T07:30:46.000Z","size":720,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T11:34:05.225Z","etag":null,"topics":["openapi","openapi-specification","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"https://tobyqin.github.io/swagger-master/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobyqin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-12T13:12:10.000Z","updated_at":"2025-01-23T07:30:49.000Z","dependencies_parsed_at":"2025-03-03T11:33:25.165Z","dependency_job_id":null,"html_url":"https://github.com/tobyqin/swagger-master","commit_stats":null,"previous_names":["tobyqin/swagger-master"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tobyqin/swagger-master","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyqin%2Fswagger-master","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyqin%2Fswagger-master/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyqin%2Fswagger-master/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyqin%2Fswagger-master/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobyqin","download_url":"https://codeload.github.com/tobyqin/swagger-master/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyqin%2Fswagger-master/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265819949,"owners_count":23833554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openapi","openapi-specification","swagger","swagger-ui"],"created_at":"2025-01-13T22:21:43.758Z","updated_at":"2025-12-31T14:39:41.424Z","avatar_url":"https://github.com/tobyqin.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swagger Master\n\n\u003cp align=\"right\"\u003e\n  \u003ca href=\"README.zh-CN.md\"\u003e中文文档\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/images/swagger-master-logo.svg\" alt=\"Swagger Master Logo\" width=\"200\"/\u003e\n  \u003cbr\u003e\n  \u003ci\u003eA lightweight, single-file Swagger UI manager for multiple OpenAPI specifications\u003c/i\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#screenshot\"\u003eScreenshot\u003c/a\u003e •\n  \u003ca href=\"#demo\"\u003eDemo\u003c/a\u003e •\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e •\n  \u003ca href=\"#customization\"\u003eCustomization\u003c/a\u003e •\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e •\n  \u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tobyqin/swagger-master/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/tobyqin/swagger-master\" alt=\"license\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/tobyqin/swagger-master/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/tobyqin/swagger-master\" alt=\"stars\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/tobyqin/swagger-master/network/members\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/forks/tobyqin/swagger-master\" alt=\"forks\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  ⭐️ If you find this project useful, please consider giving it a star to show your support! ⭐️\n\u003c/p\u003e\n\n## Features\n\n- 📦 **Single File** - No build process, no dependencies to install\n- 🔄 **Multiple API Support** - Switch between different OpenAPI specifications seamlessly\n- 🚀 **Easy Deployment** - Host anywhere as a static file\n- ⚡ **Fast Loading** - Uses CDN for all external resources\n- 🎨 **Clean UI** - Intuitive interface with API selector\n- 🔧 **Easy Configuration** - Simple API list customization\n\n## Screenshot\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/images/swagger-master.png\" alt=\"Swagger Master Screenshot\" width=\"800\"/\u003e\n  \u003cbr\u003e\n  \u003ci\u003eSwagger Master in action - managing multiple API specifications\u003c/i\u003e\n\u003c/p\u003e\n\n## Demo\n\nVisit our [live demo](https://tobyqin.github.io/swagger-master) to see Swagger Master in action.\n\n## Quick Start\n\n1. Download the `index.html` file\n2. Add your API list to the `API_LIST` array in the `index.html` file\n3. Open the `index.html` file in your browser to test it out\n4. Host anywhere as a static file\n\n## Customization\n\n### Styling\n\nThe UI is customizable through the CSS section in the `index.html` file. Key style classes:\n\n- `#api-selector` - The API selection dropdown container\n- `#swagger-ui` - The main Swagger UI container\n- `.info-icon` - The information icon styling\n\n### Configuration Options\n\nThe API list is configured in the `index.html` file. The `API_LIST` array contains the API specifications. Each API specification is an object with the following properties:\n\n```javascript\nconst API_LIST = [\n  {\n    name: \"Petstore API\",\n    url: \"https://petstore3.swagger.io/api/v3/openapi.json\",\n    description:\n      \"This is the Swagger Petstore API, a sample API that demonstrates OpenAPI specification features.\",\n    maintainer: {\n      name: \"Swagger Team\",\n      email: \"swagger@example.com\",\n    },\n  },\n  // Add more APIs as needed\n];\n```\n\nEach API configuration supports:\n\n- `name`: Display name for the API\n- `url`: URL to the OpenAPI specification JSON/YAML\n- `description`: A detailed description of the API's purpose and features\n- `maintainer`: Contact information for the API maintainer\n  - `name`: Maintainer's name\n  - `email`: Maintainer's email address\n\nThe description and maintainer information can be viewed by clicking the info icon (i) next to the API selector.\n\n## FAQ\n\n### How to fix CORS (Cross-Origin Resource Sharing) errors?\n\nIf you see errors like \"Failed to load API definition\" or \"Possible cross-origin (CORS) issue\", you can try one of these solutions:\n\n1. **Configure Backend Server** (Recommended for Production)\n\n   - Configure your API server to allow CORS requests by adding appropriate headers:\n\n   ```\n   Access-Control-Allow-Origin: *  # Or your Swagger Master domain\n   Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\n   Access-Control-Allow-Headers: *\n   ```\n\n   - This is the most secure and recommended solution for production environments\n\n2. **Use a Proxy Server** (Alternative for Production)\n\n   - Set up a proxy server (e.g., Nginx) to forward requests and add CORS headers\n   - Example Nginx configuration:\n\n   ```nginx\n   location /api/ {\n       proxy_pass http://your-api-server/;\n       add_header 'Access-Control-Allow-Origin' '*';\n       add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';\n       add_header 'Access-Control-Allow-Headers' '*';\n   }\n   ```\n\n3. **Use Browser Extensions** (Development Only)\n   - Install CORS-disabling browser extensions (e.g., \"CORS Unblock\" for Chrome)\n   - ⚠️ Warning: Only use this method for development/testing\n   - Disable the extension when not needed for security reasons\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- [Swagger UI](https://github.com/swagger-api/swagger-ui) for the amazing API documentation tool\n- [Font Awesome](https://fontawesome.com) for the icons\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by \u003ca href=\"https://github.com/tobyqin\"\u003eToby Qin\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobyqin%2Fswagger-master","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobyqin%2Fswagger-master","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobyqin%2Fswagger-master/lists"}