{"id":17801827,"url":"https://github.com/xissy/swagger-tool","last_synced_at":"2026-05-02T05:05:51.722Z","repository":{"id":147577695,"uuid":"135110863","full_name":"xissy/swagger-tool","owner":"xissy","description":"swagger-tool provides convenient tools for swagger","archived":false,"fork":false,"pushed_at":"2018-08-31T04:14:17.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-30T23:04:22.820Z","etag":null,"topics":["golang","json","swagger","swagger-codegen"],"latest_commit_sha":null,"homepage":"","language":"Go","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/xissy.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":"2018-05-28T04:52:46.000Z","updated_at":"2018-08-31T04:13:21.000Z","dependencies_parsed_at":"2023-05-31T16:31:13.457Z","dependency_job_id":null,"html_url":"https://github.com/xissy/swagger-tool","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/xissy/swagger-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Fswagger-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Fswagger-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Fswagger-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Fswagger-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xissy","download_url":"https://codeload.github.com/xissy/swagger-tool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xissy%2Fswagger-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32523441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"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","json","swagger","swagger-codegen"],"created_at":"2024-10-27T12:39:46.739Z","updated_at":"2026-05-02T05:05:51.709Z","avatar_url":"https://github.com/xissy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swagger-tool\n\u003e provides convenient tools for swagger\n\n## merge\nMerge multiple Swagger JSON files to a JSON file.\n\n* it merges `paths` fields of input files\n* it merges `definitions` fields of input files\n\n### Installation\n```\ngo get -u github.com/xissy/swagger-tool\n```\nor\n```\ndocker pull xissy/swagger-tool\n```\n\n### Usage\n```\nswagger-tool merge -i input1.json -i input2.json -o output.json\n```\nor\n```\ndocker run --rm -it -v `pwd`:/input xissy/swagger-tool merge -i /input/input_account.json -i /input/input_auth.json -o output.json\n```\n\n### Why?\n[grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway)'s\n[protoc-gen-swagger](https://github.com/grpc-ecosystem/grpc-gateway/tree/master/protoc-gen-swagger)\ngenerates seperated Swagger JSON files for each namespace. You may want to merge them to a Swagger JSON file.\n\n### Example\n#### input1.json\n```\n{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"title\": \"pb/taeho/auth/auth.proto\",\n    \"version\": \"version not set\"\n  },\n  \"schemes\": [\n    \"http\",\n    \"https\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/v1/auth/refreshToken\": {\n      \"post\": {\n        \"operationId\": \"Refresh\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/authRefreshResponse\"\n            }\n          }\n        },\n        \"parameters\": [\n          {\n            \"name\": \"body\",\n            \"in\": \"body\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/authRefreshRequest\"\n            }\n          }\n        ],\n        \"tags\": [\n          \"AuthService\"\n        ]\n      }\n    }\n  },\n  \"definitions\": {\n    \"authAuthResponse\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"access_token\": {\n          \"type\": \"string\"\n        },\n        \"refresh_token\": {\n          \"type\": \"string\"\n        },\n        \"account_id\": {\n          \"type\": \"string\"\n        },\n        \"expires_in\": {\n          \"type\": \"string\",\n          \"format\": \"int64\"\n        }\n      }\n    },\n    \"authParseResponse\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"account_id\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"authRefreshRequest\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"refresh_token\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"authRefreshResponse\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"access_token\": {\n          \"type\": \"string\"\n        },\n        \"refresh_token\": {\n          \"type\": \"string\"\n        },\n        \"account_id\": {\n          \"type\": \"string\"\n        },\n        \"expires_in\": {\n          \"type\": \"string\",\n          \"format\": \"int64\"\n        }\n      }\n    },\n    \"authValidateResponse\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"is_valid\": {\n          \"type\": \"boolean\",\n          \"format\": \"boolean\"\n        }\n      }\n    }\n  }\n}\n\n```\n\n#### input2.json\n```\n{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"title\": \"pb/taeho/account/account.proto\",\n    \"version\": \"version not set\"\n  },\n  \"schemes\": [\n    \"http\",\n    \"https\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/v1/account/logIn\": {\n      \"post\": {\n        \"operationId\": \"LogIn\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/accountLogInResponse\"\n            }\n          }\n        },\n        \"parameters\": [\n          {\n            \"name\": \"body\",\n            \"in\": \"body\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/accountLogInRequest\"\n            }\n          }\n        ],\n        \"tags\": [\n          \"AccountService\"\n        ]\n      }\n    },\n    \"/v1/account/register\": {\n      \"post\": {\n        \"operationId\": \"Register\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/accountRegisterResponse\"\n            }\n          }\n        },\n        \"parameters\": [\n          {\n            \"name\": \"body\",\n            \"in\": \"body\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/accountRegisterRequest\"\n            }\n          }\n        ],\n        \"tags\": [\n          \"AccountService\"\n        ]\n      }\n    }\n  },\n  \"definitions\": {\n    \"accountAuthType\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"NONE\",\n        \"EMAIL\"\n      ],\n      \"default\": \"NONE\"\n    },\n    \"accountLogInRequest\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"auth_type\": {\n          \"$ref\": \"#/definitions/accountAuthType\"\n        },\n        \"email\": {\n          \"type\": \"string\"\n        },\n        \"password\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"accountLogInResponse\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"access_token\": {\n          \"type\": \"string\"\n        },\n        \"refresh_token\": {\n          \"type\": \"string\"\n        },\n        \"account_id\": {\n          \"type\": \"string\"\n        },\n        \"token_type\": {\n          \"type\": \"string\"\n        },\n        \"expires_in\": {\n          \"type\": \"string\",\n          \"format\": \"int64\"\n        }\n      }\n    },\n    \"accountRegisterRequest\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"auth_type\": {\n          \"$ref\": \"#/definitions/accountAuthType\"\n        },\n        \"email\": {\n          \"type\": \"string\"\n        },\n        \"password\": {\n          \"type\": \"string\"\n        },\n        \"full_name\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"accountRegisterResponse\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"auth_type\": {\n          \"$ref\": \"#/definitions/accountAuthType\"\n        },\n        \"account_id\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}\n```\n\n#### output.json\n```\n{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"title\": \"API\",\n    \"version\": \"v1\"\n  },\n  \"schemes\": [\n    \"http\",\n    \"https\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/v1/account/logIn\": {\n      \"post\": {\n        \"operationId\": \"LogIn\",\n        \"parameters\": [\n          {\n            \"in\": \"body\",\n            \"name\": \"body\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/accountLogInRequest\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/accountLogInResponse\"\n            }\n          }\n        },\n        \"tags\": [\n          \"AccountService\"\n        ]\n      }\n    },\n    \"/v1/account/register\": {\n      \"post\": {\n        \"operationId\": \"Register\",\n        \"parameters\": [\n          {\n            \"in\": \"body\",\n            \"name\": \"body\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/accountRegisterRequest\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/accountRegisterResponse\"\n            }\n          }\n        },\n        \"tags\": [\n          \"AccountService\"\n        ]\n      }\n    },\n    \"/v1/auth/refreshToken\": {\n      \"post\": {\n        \"operationId\": \"Refresh\",\n        \"parameters\": [\n          {\n            \"in\": \"body\",\n            \"name\": \"body\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/authRefreshRequest\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/authRefreshResponse\"\n            }\n          }\n        },\n        \"tags\": [\n          \"AuthService\"\n        ]\n      }\n    }\n  },\n  \"definitions\": {\n    \"accountAuthType\": {\n      \"default\": \"NONE\",\n      \"enum\": [\n        \"NONE\",\n        \"EMAIL\"\n      ],\n      \"type\": \"string\"\n    },\n    \"accountLogInRequest\": {\n      \"properties\": {\n        \"auth_type\": {\n          \"$ref\": \"#/definitions/accountAuthType\"\n        },\n        \"email\": {\n          \"type\": \"string\"\n        },\n        \"password\": {\n          \"type\": \"string\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"accountLogInResponse\": {\n      \"properties\": {\n        \"access_token\": {\n          \"type\": \"string\"\n        },\n        \"account_id\": {\n          \"type\": \"string\"\n        },\n        \"expires_in\": {\n          \"format\": \"int64\",\n          \"type\": \"string\"\n        },\n        \"refresh_token\": {\n          \"type\": \"string\"\n        },\n        \"token_type\": {\n          \"type\": \"string\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"accountRegisterRequest\": {\n      \"properties\": {\n        \"auth_type\": {\n          \"$ref\": \"#/definitions/accountAuthType\"\n        },\n        \"email\": {\n          \"type\": \"string\"\n        },\n        \"full_name\": {\n          \"type\": \"string\"\n        },\n        \"password\": {\n          \"type\": \"string\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"accountRegisterResponse\": {\n      \"properties\": {\n        \"account_id\": {\n          \"type\": \"string\"\n        },\n        \"auth_type\": {\n          \"$ref\": \"#/definitions/accountAuthType\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"authAuthResponse\": {\n      \"properties\": {\n        \"access_token\": {\n          \"type\": \"string\"\n        },\n        \"account_id\": {\n          \"type\": \"string\"\n        },\n        \"expires_in\": {\n          \"format\": \"int64\",\n          \"type\": \"string\"\n        },\n        \"refresh_token\": {\n          \"type\": \"string\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"authParseResponse\": {\n      \"properties\": {\n        \"account_id\": {\n          \"type\": \"string\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"authRefreshRequest\": {\n      \"properties\": {\n        \"refresh_token\": {\n          \"type\": \"string\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"authRefreshResponse\": {\n      \"properties\": {\n        \"access_token\": {\n          \"type\": \"string\"\n        },\n        \"account_id\": {\n          \"type\": \"string\"\n        },\n        \"expires_in\": {\n          \"format\": \"int64\",\n          \"type\": \"string\"\n        },\n        \"refresh_token\": {\n          \"type\": \"string\"\n        }\n      },\n      \"type\": \"object\"\n    },\n    \"authValidateResponse\": {\n      \"properties\": {\n        \"is_valid\": {\n          \"format\": \"boolean\",\n          \"type\": \"boolean\"\n        }\n      },\n      \"type\": \"object\"\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxissy%2Fswagger-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxissy%2Fswagger-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxissy%2Fswagger-tool/lists"}