{"id":31060811,"url":"https://github.com/algorithmalchemy/template-custom-swagger","last_synced_at":"2026-05-16T01:31:34.103Z","repository":{"id":313739169,"uuid":"1052122290","full_name":"AlgorithmAlchemy/Template-Custom-Swagger","owner":"AlgorithmAlchemy","description":"Template repository for customizing the standard Swagger UI","archived":false,"fork":false,"pushed_at":"2025-09-09T11:03:58.000Z","size":137,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-15T10:55:03.265Z","etag":null,"topics":["custom-swagger","fastapi","swagger","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/AlgorithmAlchemy.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-07T13:00:30.000Z","updated_at":"2025-09-09T11:04:02.000Z","dependencies_parsed_at":"2025-09-08T07:17:17.823Z","dependency_job_id":"5f24f1ee-c47c-45af-b63e-aa5e6bff181f","html_url":"https://github.com/AlgorithmAlchemy/Template-Custom-Swagger","commit_stats":null,"previous_names":["algorithmalchemy/template-custom-swagger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlgorithmAlchemy/Template-Custom-Swagger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlgorithmAlchemy%2FTemplate-Custom-Swagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlgorithmAlchemy%2FTemplate-Custom-Swagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlgorithmAlchemy%2FTemplate-Custom-Swagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlgorithmAlchemy%2FTemplate-Custom-Swagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlgorithmAlchemy","download_url":"https://codeload.github.com/AlgorithmAlchemy/Template-Custom-Swagger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlgorithmAlchemy%2FTemplate-Custom-Swagger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33087028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["custom-swagger","fastapi","swagger","swagger-ui"],"created_at":"2025-09-15T10:47:34.570Z","updated_at":"2026-05-16T01:31:34.097Z","avatar_url":"https://github.com/AlgorithmAlchemy.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Swagger UI Template\n\n[🇬🇧 English](README.md) | [🇷🇺 Русский](README_ru.md) | [🇪🇸 Español](README_es.md)\n\nA template for customizing the standard Swagger UI. This template replaces the default top bar with a custom, brandable one, and adds features like API specification export, dark mode, and enhanced micro-interactions.\n\n\u003cimg src=\"swagger.png\" alt=\"Custom Swagger UI Screenshot\" width=\"50%\"\u003e\n\n\n## Features\n\n-   **Custom Branded Top Bar**: Easily add your company logo, custom links, and contact information.\n-   **API Specification Export**: Buttons to export the API definition in `JSON` and `YAML`, `PDF` formats.\n-   **Dark Mode**: A sleek, modern dark theme for the entire UI, toggleable by the user.\n-   **Responsive Design**: The custom UI is fully responsive and works on mobile devices.\n-   **Enhanced Micro-interactions**: Smooth animations, ripple effects on buttons, and scroll-to-top functionality for a better user experience.\n-   **Easy Integration**: Simply include the CSS and JavaScript files in your existing Swagger UI setup.\n\n## Getting Started\n\n### Prerequisites\n\nYou need to have a working Swagger UI instance. This template is designed to be an overlay on top of the standard Swagger UI.\n\n### Installation\n\n1.  Clone this repository or download the files.\n2.  Copy the following files to the static assets directory of your web server where your Swagger UI is hosted:\n    -   `custom-swagger.css`\n    -   `custom-swagger.js`\n    -   `swagger_custom.css`\n    -   `swagger_custom.js`\n\n### Usage\n\nIn your HTML file that serves Swagger UI, include the custom CSS and JavaScript files. Make sure to load them **after** the official Swagger UI assets.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003ctitle\u003eMy API Docs\u003c/title\u003e\n    \u003c!-- Standard Swagger UI CSS --\u003e\n    \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"https://unpkg.com/swagger-ui-dist@3/swagger-ui.css\"\u003e\n\n    \u003c!-- Custom CSS --\u003e\n    \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"/static/custom-swagger.css\"\u003e\n    \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"/static/swagger_custom.css\"\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003cdiv id=\"swagger-ui\"\u003e\u003c/div\u003e\n\n    \u003c!-- Standard Swagger UI JavaScript --\u003e\n    \u003cscript src=\"https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/swagger-ui-dist@3/swagger-ui-standalone-preset.js\"\u003e\u003c/script\u003e\n\n    \u003cscript\u003e\n    window.onload = function() {\n      // Build a system\n      const ui = SwaggerUIBundle({\n        url: \"https://petstore.swagger.io/v2/swagger.json\",\n        dom_id: '#swagger-ui',\n        deepLinking: true,\n        presets: [\n          SwaggerUIBundle.presets.apis,\n          SwaggerUIStandalonePreset\n        ],\n        plugins: [\n          SwaggerUIBundle.plugins.DownloadUrl\n        ],\n        layout: \"StandaloneLayout\"\n      })\n      window.ui = ui\n    }\n    \u003c/script\u003e\n\n    \u003c!-- Custom JavaScript --\u003e\n    \u003cscript src=\"/static/custom-swagger.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"/static/swagger_custom.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Configuration\n\nYou can customize the top bar by editing `custom-swagger.js`.\n\n-   **Logo and Links**: Find the `createBlueStrip` function and modify the `stripHTML` constant to change the logo, links, and text.\n-   **Export file names**: You can change the default names for exported files in the `download` attribute of the anchor tags within `stripHTML`.\n\nThe styles can be modified in `custom-swagger.css` and `swagger_custom.css`.\n\n## File Structure\n\n-   `custom-swagger.js`: Handles the creation of the custom top bar and its elements.\n-   `custom-swagger.css`: Provides the styles for the custom top bar.\n-   `swagger_custom.js`: Contains logic for advanced features like theme switching, micro-interactions, and the scroll-to-top button.\n-   `swagger_custom.css`: Contains extensive styles for the dark theme, responsive design, and other UI enhancements.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgorithmalchemy%2Ftemplate-custom-swagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falgorithmalchemy%2Ftemplate-custom-swagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgorithmalchemy%2Ftemplate-custom-swagger/lists"}