{"id":18731168,"url":"https://github.com/qustavo/swagger-proxy","last_synced_at":"2025-12-15T15:36:07.647Z","repository":{"id":57509473,"uuid":"91815027","full_name":"qustavo/swagger-proxy","owner":"qustavo","description":"Swagger Proxy validates HTTP Responses given an OpenAPI definition","archived":false,"fork":false,"pushed_at":"2019-02-12T05:11:06.000Z","size":7217,"stargazers_count":20,"open_issues_count":4,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T05:14:58.330Z","etag":null,"topics":["go","openapi","proxy","swagger","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","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/qustavo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-19T14:36:49.000Z","updated_at":"2025-01-21T16:36:49.000Z","dependencies_parsed_at":"2022-09-26T17:51:09.753Z","dependency_job_id":null,"html_url":"https://github.com/qustavo/swagger-proxy","commit_stats":null,"previous_names":["gchaincl/swagger-proxy"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qustavo%2Fswagger-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qustavo%2Fswagger-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qustavo%2Fswagger-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qustavo%2Fswagger-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qustavo","download_url":"https://codeload.github.com/qustavo/swagger-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610407,"owners_count":21132920,"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":["go","openapi","proxy","swagger","testing"],"created_at":"2024-11-07T14:56:31.347Z","updated_at":"2025-12-15T15:36:02.595Z","avatar_url":"https://github.com/qustavo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swagger-proxy [![Build Status](https://travis-ci.org/gchaincl/swagger-proxy.svg?branch=master)](https://travis-ci.org/gchaincl/swagger-proxy)\nSwagger Proxy ensure HTTP Responses correctness based on swagger specs. \n\n# Usage\nSwaggerProxy is designed to assist the development process, it can be used as a reverse proxy or as a middleware.\n\n## Reverse Proxy\nSwaggerProxy sits between the client/integration suite and the server as follows:\n```\n[Client] ---\u003e [SwaggerProxy] ---\u003e [Server]\n```\nSwaggerProxy will rely the request and analize the server response.\n\n### Install\n```bash\ngo get github.com/gchaincl/swagger-proxy/cmd/swagger-proxy`\n```\n### Run\n```bash\n$ swagger-proxy -h\nUsage of swagger-proxy:\n  -bind string\n        Bind Address (default \":1234\")\n  -spec string\n        Swagger Spec (default \"swagger.yml\")\n  -target string\n        Target (default \"http://localhost:4321\")\n  -verbose\n        Verbose\n```\n\n## Middleware\nIf your server is built in Golang, you can use it as a middleware:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\tproxy \"github.com/gchaincl/swagger-proxy\"\n\t\"github.com/go-openapi/loads\"\n)\n\nfunc main() {\n\tdoc, err := loads.Spec(\"swagger.json\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tp, err := proxy.New(doc.Spec(), \u0026proxy.LogReporter{}, proxy.WithVerbose(true))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tapp := func(w http.ResponseWriter, req *http.Request) {\n\t\tif req.Method == \"POST\" {\n\t\t\tw.WriteHeader(201)\n\t\t}\n\t}\n\tlog.Printf(\"Server Running\")\n\thttp.ListenAndServe(\":8989\", p.Handler(http.HandlerFunc(app)))\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqustavo%2Fswagger-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqustavo%2Fswagger-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqustavo%2Fswagger-proxy/lists"}