{"id":23651905,"url":"https://github.com/microfocus/swagger-ui","last_synced_at":"2025-07-15T23:36:33.900Z","repository":{"id":46929571,"uuid":"247183983","full_name":"MicroFocus/swagger-ui","owner":"MicroFocus","description":"https://microfocus.github.io/swagger-ui/","archived":false,"fork":false,"pushed_at":"2023-12-20T14:35:06.000Z","size":4732,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-07-04T15:11:03.591Z","etag":null,"topics":["openapi","rest","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicroFocus.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":"2020-03-14T00:19:18.000Z","updated_at":"2025-05-21T04:24:20.000Z","dependencies_parsed_at":"2023-12-20T16:10:32.891Z","dependency_job_id":null,"html_url":"https://github.com/MicroFocus/swagger-ui","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/MicroFocus/swagger-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fswagger-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fswagger-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fswagger-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fswagger-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicroFocus","download_url":"https://codeload.github.com/MicroFocus/swagger-ui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroFocus%2Fswagger-ui/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265467615,"owners_count":23770752,"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","rest","swagger-ui"],"created_at":"2024-12-28T16:48:58.798Z","updated_at":"2025-07-15T23:36:33.844Z","avatar_url":"https://github.com/MicroFocus.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open Text Swagger UI\n\nThis project is an Open Text branded version of the [Swagger UI](https://github.com/swagger-api/swagger-ui).\n\n## Usage\n\nIt can be used from another Java project by including the following dependency:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.microfocus.webjars\u003c/groupId\u003e\n    \u003cartifactId\u003eswagger-ui-dist\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\nTo override swagger configuration params include a **opentext-config.js** file, similar to the one [here](./src/main/resources/opentext-config.js):\n\nSwagger configuration params that can be set in opentext-config.js:\n - url: \"api-docs/swagger.yaml\"\n - dom_id: \"#swagger-ui\n - operationsSorter: \"alpha\"\n - tagsSorter: \"alpha\"\n - docExpansion: \"none\"\n - defaultModelsExpandDepth: -1\n - deepLinking: true\n\nFor a complete list of swagger configuration params refer [Swagger configuration params](https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md#core).\n\n## Using this module in Spring Boot\n\n1. Add the module as a `runtime` dependency.\n2. Include a resource file called **opentext-config.js** with the swagger configuration overrides, similar to the one [here](./src/main/resources/opentext-config.js).\nMake sure to overide the \"url\" param to point to your swagger contract.\n3. To facilitate [serving static resources](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/config/annotation/ResourceHandlerRegistry.html) in Spring Boot override the `addResourceHandlers` function in \n\n```java\n@Override\npublic void addResourceHandlers(final ResourceHandlerRegistry registry) {\n\n    // Configure the external-facing URI path by adding a resource handler\n    final ResourceHandlerRegistration resourceHandlerRegistration = registry.addResourceHandler(\"/swagger/**\");\n\n    // Map that external-facing URI path internally to the physical path where the resources are actually located\n    resourceHandlerRegistration.addResourceLocations(\n                                    \"classpath:/swagger/\",\n                                    swaggerContractPath,\n                                    \"classpath:/META-INF/resources/webjars/opentext-swagger-ui-dist/2.0.0/\");\n\n    final ResourceChainRegistration resourceChainRegistration = resourceRegistration.resourceChain(true);\n    resourceChainRegistration.addResolver(new PathResourceResolver());\n}\n```\n\n## Using this module in Dropwizard\n\n1. Add the module as a `runtime` dependency.\n2. Include a resource file called **swagger-ui-config.js** to override the swagger configuration, similar to the one [here](./src/main/resources/opentext-config.js).\nMake sure to overide the \"url\" param to point to your swagger contract.\n3. To facilitate serving static resources in Dropwizard add [AssetBundles](https://www.dropwizard.io/en/latest/manual/core.html#bundles)\n\n```java\n@Override\npublic void initialize(Bootstrap\u003cT\u003e bootstrap) {\n    bootstrap.addBundle(new AssetsBundle(\n        \"/META-INF/resources/webjars/opentext-swagger-ui-dist/2.0.0/\", \"/swagger/\", \"index.html\", \"swagger-ui\"));\n    bootstrap.addBundle(new AssetsBundle(\n        \"/swagger-ui-config.js\", \"/swagger/opentext-config.js\", null, \"swagger-ui-config\"));\n\n    super.initialize(bootstrap);\n}\n```\n\n## Using this module in Tomcat\n1. Include a resource file called **opentext-config.js** with the swagger configuration overrides, similar to the one [here](./src/main/resources/opentext-config.js).\nMake sure to overide the \"url\" param to point to your swagger contract.\n2. Repackage the swagger assets into the war file to be deployed in Tomcat.\n\n**Unpack the swagger-ui artifact excluding the default configuration file**\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n    \u003cartifactId\u003emaven-dependency-plugin\u003c/artifactId\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eunpack\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cartifactItems\u003e\n                    \u003cartifactItem\u003e\n                        \u003cgroupId\u003ecom.github.microfocus\u003c/groupId\u003e\n                        \u003cartifactId\u003eswagger-ui-dist\u003c/artifactId\u003e\n                        \u003cversion\u003e1.0.0\u003c/version\u003e\n                        \u003coutputDirectory\u003e${project.build.directory}/swagger-ui\u003c/outputDirectory\u003e\n                        \u003cexcludes\u003e\n                            META-INF/resources/webjars/opentext-swagger-ui-dist/2.0.0/opentext-config.js\n                        \u003c/excludes\u003e\n                    \u003c/artifactItem\u003e\n                \u003c/artifactItems\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n**Package the war file with the swagger-ui assets and the swagger-ui configuration overide file**\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n    \u003cartifactId\u003emaven-war-plugin\u003c/artifactId\u003e\n    \u003cconfiguration\u003e\n        \u003cfailOnMissingWebXml\u003efalse\u003c/failOnMissingWebXml\u003e\n        \u003cwebResources\u003e\n            \u003cresource\u003e\n                \u003c!--Include swagger-ui assets--\u003e\n                \u003cdirectory\u003e\n                  ${project.build.directory}/swagger-ui/META-INF/resources/webjars/opentext-swagger-ui-dist/2.0.0\n                \u003c/directory\u003e\n                \u003ctargetPath\u003e.\u003c/targetPath\u003e\n            \u003c/resource\u003e\n            \u003cresource\u003e\n                \u003c!--Include opentext-config.js overide file from src/main/html--\u003e\n                \u003cdirectory\u003esrc/main/html\u003c/directory\u003e\n                \u003ctargetPath\u003e.\u003c/targetPath\u003e\n            \u003c/resource\u003e\n            \u003cresource\u003e\n                \u003c!--Include swagger contract--\u003e\n                \u003cdirectory\u003e\n                  ${project.build.directory}/swagger-contract/com/hpe/darwin/tag/service/contract\n                \u003c/directory\u003e\n                \u003ctargetPath\u003eapi-docs\u003c/targetPath\u003e\n            \u003c/resource\u003e\n        \u003c/webResources\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\n## Using as an NPM package\nThis module, `opentext-swagger-ui-dist`, is a dependency-free module that includes everything required to serve OpenText-branded Swagger UI in a server-side project, or a single-page application that can't resolve npm module dependencies.\n\n    npm install git+ssh://git@github.com/MicroFocus/swagger-ui.git#v2.0.0-dist\n\nOr alternatively if you prefer not to use a **git** url:\n\n    npm install https://github.com/MicroFocus/swagger-ui/archive/v2.0.0-dist.tar.gz\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrofocus%2Fswagger-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrofocus%2Fswagger-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrofocus%2Fswagger-ui/lists"}