4.0.1 • Published 2 years ago

oas-reducer v4.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

oas-reducer

Reduce an OpenAPI definition into a smaller subset.

Build npm.io

npm.io

Installation

npm install -g oas-reducer

Usage

Library

import oasReducer from 'oas-reducer';

console.log(
  oasReducer(<OpenAPI definition>, options)
);

⚠️ Note that the API definition supplied here must be: an OpenAPI 3.x definition and a JSON object.

Available options

  • tags: An array of tags to reduce by. Example: ['pet']
  • paths: A key-value object of path + method combinations to reduce by. Example: {'/pet': ['get', 'post']}
    • If you wish to retain all methods of a given path, supply * as the method array instead. Example: {'/pet': '*'}

CLI

$ oas-reducer <OpenAPI definition to reduce>

The 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! 🏅

⚠️ Note that the API definition supplied here must be an OpenAPI 3.x definition and can be either a JSON or YAML file path.

4.0.1

2 years ago

4.0.0

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago