{"id":22865559,"url":"https://github.com/tecfu/postman-to-swagger","last_synced_at":"2025-05-05T15:18:33.583Z","repository":{"id":42802550,"uuid":"227326423","full_name":"tecfu/postman-to-swagger","owner":"tecfu","description":"Convert Postman 2.1 Collections to Swagger 2.0 or OpenAPI 3.0","archived":false,"fork":false,"pushed_at":"2023-03-04T23:31:05.000Z","size":104,"stargazers_count":41,"open_issues_count":6,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-15T22:12:00.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/tecfu.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}},"created_at":"2019-12-11T09:28:35.000Z","updated_at":"2024-01-17T08:35:52.000Z","dependencies_parsed_at":"2023-02-06T23:15:53.018Z","dependency_job_id":null,"html_url":"https://github.com/tecfu/postman-to-swagger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecfu%2Fpostman-to-swagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecfu%2Fpostman-to-swagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecfu%2Fpostman-to-swagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tecfu%2Fpostman-to-swagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tecfu","download_url":"https://codeload.github.com/tecfu/postman-to-swagger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229538526,"owners_count":18088898,"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":[],"created_at":"2024-12-13T11:37:37.085Z","updated_at":"2024-12-13T11:37:37.742Z","avatar_url":"https://github.com/tecfu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postman to Swagger\n\nThis project intends to output a valid `swagger.yaml` or `openapi.yaml` file from a Postman collection input.\n\nYou can convert:\n\n| INPUT | OUTPUT |\n|---|---|\n| [Postman 2.1](https://schema.getpostman.com/json/collection/latest/docs/index.html) (`PostmanCollection.json`) | [Swagger 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) (`swagger.yaml`) \u003cbr/\u003e\u003cbr/\u003e[OpenAPI 3.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) (`openapi.yaml`)|\n\n\n\u003e Please Note:\n\nPostman schema doesn't quite match up 1-to-1 against Swagger/OpenAPI schema.\nSo some target spec defaults are automatically implemented when absent in the source spec.\n\n\n## Installation\n\n```sh\nnpm install tecfu/postman-to-swagger\n```\n\n## Options\n\u003ca name=\"options_properties\"\u003e\u003c/a\u003e\n\n\n### Options: All Targets Specs ```object```\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| source_spec | \u003ccode\u003estring\u003c/code\u003e | default: \"postman2.1\". \u003cbr/\u003e options: \"postman2.1\" |\n| target_spec | \u003ccode\u003estring\u003c/code\u003e | default: \"openapi3.0\". \u003cbr/\u003e options: \"swagger2.0\", \"openapi3.0\" |\n| require_all | \u003ccode\u003earray\u003c/code\u003e | default: [\"headers\", \"body\", \"query\", \"path\"]  |\n| omit | \u003ccode\u003eobject\u003c/code\u003e | default: {\u003cbr/\u003eheaders: [\"Content-Type\", \"X-Requested-With\"]\u003cbr/\u003e} |\n| info | \u003ccode\u003eobject\u003c/code\u003e | default: {} |\n| responses | \u003ccode\u003eobject\u003c/code\u003e | default: {\u003cbr/\u003e200: {\u003cbr/\u003edescription: \"OK\"\u003cbr/\u003e}\u003cbr/\u003e} |\n\n\n\n### Options: Swagger 2.x ```object```\n\n| Param | Type | Description |\n| --- | --- | --- |\n| host | \u003ccode\u003estring\u003c/code\u003e | default: '' \u003cbr/\u003e Note: Only applies to Swagger 2.0 output |\n| basepath | \u003ccode\u003estring\u003c/code\u003e | default: '' \u003cbr/\u003e Note: Only applies to Swagger 2.0 output |\n| schemes | \u003ccode\u003estring\u003c/code\u003e | default: '' \u003cbr/\u003e Note: Only applies to Swagger 2.0 output |\n\n\n\n### Options: OpenAPI 3.x ```object```\n\n| Param | Type | Description |\n| --- | --- | --- |\n| servers | \u003ccode\u003earray\u003c/code\u003e | default: []  \u003cbr/\u003e Note: Only applies to OpenAPI 3.0 output |\n\n\n\n## Example\n\n```js\nconst p2s = require('postman-to-swagger')\nconst yaml = require('js-yaml')\nconst fs = require('fs')\nconst postmanJson = require('./postman_collection.json')\nconst swaggerJson = p2s(postmanJson, {\n  target_spec: \"swagger2.0\",\n  info: {\n    version: 'v1'\n  }\n})\n\n//let output = JSON.stringify(swaggerJson, null, 2)\nlet output = yaml.safeDump(swaggerJson)\n\n// Save to file\nfs.writeFileSync(\n  'swagger.yaml',\n  output,\n  'utf8'\n)\n```\n\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecfu%2Fpostman-to-swagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftecfu%2Fpostman-to-swagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecfu%2Fpostman-to-swagger/lists"}