# openapi-link-generator

> A Tool to add link definitions to an OpenAPI documentation

Latest version **0.1.3** (published 2019-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install openapi-link-generator
pnpm add openapi-link-generator
yarn add openapi-link-generator
bun add openapi-link-generator
```

Provides the command `openapi-link-generator`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2019-09-28 |
| First published | 2019-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 52 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Dominik Kus |
| Maintainers | dominikks |
| Keywords | openapi |

## Links

- npm: https://www.npmjs.com/package/openapi-link-generator
- Repository: https://github.com/rwth-acis/openapi-link-generator
- Homepage: https://github.com/rwth-acis/openapi-link-generator#readme
- Issues: https://github.com/rwth-acis/openapi-link-generator/issues
- npm.io page: https://npm.io/package/openapi-link-generator

## Dependencies (7)

- [yaml](https://npm.io/package/yaml.md) ^1.6.0
- [yargs](https://npm.io/package/yargs.md) ^13.3.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [loglevel](https://npm.io/package/loglevel.md) ^1.6.3
- [oas-validator](https://npm.io/package/oas-validator.md) ^3.3.1
- [openapi-types](https://npm.io/package/openapi-types.md) ^1.3.5
- [swagger2openapi](https://npm.io/package/swagger2openapi.md) ^5.3.1

## Recent versions

- 0.1.3 (latest) — 2019-09-28
- 0.1.2 — 2019-09-15
- 0.1.1 — 2019-09-04
- 0.1.0 — 2019-09-04

## README

# OpenAPI-Link-Generator

OpenAPI-Link-Generator is a tool that enhances an existing OpenAPI documentation by adding link definitions whenever possible.
It accepts Swagger/OpenAPI 2.0 or OpenAPI 3.0 input.
The output is always in OpenAPI 3.0 format.
Both YAML and JSON are supported.

## Assumption

The link-generator works on the assumption that when there are two parameters for two different paths that have the same name and the same schema, those parameters are semantically identical.

## Functionality

The link-generator adds a link from path A to path B whenever:

- Path B starts with path A (e.g. `A = /example` and `B = /example/extension`)
- The required parameters for path B are a subset of all the parameters for path A (considering the assumption above)

## Getting Started

OpenAPI-Link-Generator can directly be run using `npx`:

```
npx openapi-link-generator [options] <Swagger/OpenAPI file path>
```

You can run the following command to print the help-page:

```
npx openapi-link-generator --help
```

## Development

### Prerequisites

To work with the program make sure you have a recent version of node installed.
The tool was tested with node `v10.15` but other recent versions should work as well.
Then, install the necessary dependencies by running

```
npm install
```

in the project root directory.

### Run

You can run the tool by executing

```
npm start -- <arguments>
```

where `arguments` are the command line arguments you want to pass to the tool.
You can use the help-argument to find out what arguments are supported:

```
npm start -- --help
```

### Develop

You can now run the tool in development mode by executing

```
npm run dev -- <arguments>
```

The difference to `npm start` is that the program will automatically recompile and rerun when any of the source files change.

### Test

To run the tests, simply execute

```
npm test
```

---
_Source: https://npm.io/package/openapi-link-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
