{"id":14986638,"url":"https://github.com/ahlusar1989/swagger-ui","last_synced_at":"2026-01-04T17:04:30.048Z","repository":{"id":80545536,"uuid":"142702990","full_name":"ahlusar1989/swagger-ui","owner":"ahlusar1989","description":"Swagger Server POC","archived":false,"fork":false,"pushed_at":"2018-07-29T13:49:17.000Z","size":14811,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T17:26:47.126Z","etag":null,"topics":["golang","open-api","open-api-specification","swagger","swagger-codegen","swagger-specification","swagger-ui"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahlusar1989.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-07-28T19:03:14.000Z","updated_at":"2018-07-29T20:47:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b26fb2e-ce15-491b-8d2b-d94f4e7f513b","html_url":"https://github.com/ahlusar1989/swagger-ui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ahlusar1989/swagger-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2Fswagger-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2Fswagger-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2Fswagger-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2Fswagger-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahlusar1989","download_url":"https://codeload.github.com/ahlusar1989/swagger-ui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahlusar1989%2Fswagger-ui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28206369,"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","status":"online","status_checked_at":"2026-01-04T02:00:06.065Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["golang","open-api","open-api-specification","swagger","swagger-codegen","swagger-specification","swagger-ui"],"created_at":"2024-09-24T14:13:16.063Z","updated_at":"2026-01-04T17:04:30.022Z","avatar_url":"https://github.com/ahlusar1989.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swagger Server POC\n\nStep 1: Install go-swagger\n\n* `\nbrew tap go-swagger/go-swagger \u0026\u0026 \nbrew install go-swagger\n`\n\nStep 2: Install dependencies using Glide (install using `brew install glide`)\n\n`glide install`\n\nStep 3:\n\n`go build main.go`\n\nStep 4: \n\n`go run main.go`\n\n# Generating a Server\n\n## Resources used to create Swagger YAML that includes definitions and operations:\n* [Swagger Toolbox](https://swagger-toolbox.firebaseapp.com/) - YAML --\u003e JSON\n\nIn order to generate a server:\n\n`swagger generate server -f ./swagger/swagger.yml`\n\nThis command will spill out the actions it takes as it generates your new REST server. Do not follow the advice at the end of the output. There’s an alternate mechanism to do so. Just use glide to update dependencies: `glide up -v`.\n\n# Generating the UI\n\n## Downloading SwaggerUI files\n\nSwaggerUI can be downloaded from their GitHub Repo. Once downloaded, place the content of dist folder somewhere in your Go project. Then generate the spec:\n\n`swagger generate spec -o ./swagger/swagger.json --scan-models`\n\nAfter that, move swagger.json file to swaggerui folder, and inside index.html change url to ./swagger.json (url: \"./swagger.json\").\n\nThe `main.go` has two go routines that spin up two goroutines - one for each server. \n\nThe Swagger UI dist is served using the following logic and handler function:\n\n```\nfs := http.FileServer(http.Dir(\"./swaggerui\"))\nhttp.Handle(\"/swaggerui/\", http.StripPrefix(\"/swaggerui/\", fs))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahlusar1989%2Fswagger-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahlusar1989%2Fswagger-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahlusar1989%2Fswagger-ui/lists"}