{"id":15091476,"url":"https://github.com/readmeio/oas-reducer","last_synced_at":"2025-10-06T11:30:28.636Z","repository":{"id":39101338,"uuid":"387551402","full_name":"readmeio/oas-reducer","owner":"readmeio","description":"Reduce an OpenAPI definition into a smaller subset.","archived":true,"fork":false,"pushed_at":"2022-10-28T22:25:28.000Z","size":474,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-09-25T10:41:59.193Z","etag":null,"topics":["oas","openapi"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/readmeio.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":"2021-07-19T17:57:02.000Z","updated_at":"2024-09-12T13:38:36.000Z","dependencies_parsed_at":"2023-01-19T18:33:25.779Z","dependency_job_id":null,"html_url":"https://github.com/readmeio/oas-reducer","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readmeio%2Foas-reducer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readmeio%2Foas-reducer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readmeio%2Foas-reducer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/readmeio%2Foas-reducer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/readmeio","download_url":"https://codeload.github.com/readmeio/oas-reducer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219877262,"owners_count":16554852,"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":["oas","openapi"],"created_at":"2024-09-25T10:41:17.699Z","updated_at":"2025-10-06T11:30:28.269Z","avatar_url":"https://github.com/readmeio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Warning**\n\u003e\n\u003e `oas-reducer` has moved! If you're looking for the CLI reducer you can use it in [rdme](https://npm.im/rdme) with its `rdme openapi:reduce` command, ad if you're looking for the programmatic API aspect of this library that has been relocated into [oas](https://npm.im/oas)\n\n# oas-reducer\n\nReduce an OpenAPI definition into a smaller subset.\n\n[![Build](https://github.com/readmeio/oas-reducer/workflows/CI/badge.svg)](https://github.com/readmeio/oas-reducer/) [![](https://img.shields.io/npm/v/oas-reducer)](https://npm.im/oas-reducer)\n\n[![](https://d3vv6lp55qjaqc.cloudfront.net/items/1M3C3j0I0s0j3T362344/Untitled-2.png)](https://readme.com)\n\n## Installation\n\n```\nnpm install -g oas-reducer\n```\n\n## Usage\n\n### Library\n\n```js\nimport oasReducer from 'oas-reducer';\n\nconsole.log(\n  oasReducer(\u003cOpenAPI definition\u003e, options)\n);\n```\n\n\u003e ⚠️ Note that the API definition supplied here must be: an OpenAPI 3.x definition and a JSON object.\n\n#### Available options\n\n- `tags`: An array of tags to reduce by. Example: `['pet']`\n- `paths`: A key-value object of path + method combinations to reduce by. Example: `{'/pet': ['get', 'post']}`\n  - If you wish to retain all methods of a given path, supply `*` as the method array instead. Example: `{'/pet': '*'}`\n\n### CLI\n\n```shell\n$ oas-reducer \u003cOpenAPI definition to reduce\u003e\n```\n\nThe CLI will walk you through a couple of questions about how and what you want to reduce the file by and then it'll prompt you to save the newly reduced API definition to a new file! 🏅\n\n\u003e ⚠️ Note that the API definition supplied here must be an OpenAPI 3.x definition and can be either a JSON or YAML file path.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freadmeio%2Foas-reducer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freadmeio%2Foas-reducer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freadmeio%2Foas-reducer/lists"}