Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rwth-acis/openapi-link-generator
Automatically add link definitions to Swagger/OpenAPI documentations
https://github.com/rwth-acis/openapi-link-generator
openapi swagger
Last synced: 16 days ago
JSON representation
Automatically add link definitions to Swagger/OpenAPI documentations
- Host: GitHub
- URL: https://github.com/rwth-acis/openapi-link-generator
- Owner: rwth-acis
- License: mit
- Created: 2019-08-04T13:08:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:04:18.000Z (about 2 years ago)
- Last Synced: 2024-08-09T06:39:46.845Z (5 months ago)
- Topics: openapi, swagger
- Language: TypeScript
- Homepage: https://openapi-link-generator.herokuapp.com/
- Size: 771 KB
- Stars: 3
- Watchers: 9
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAPI-Link-Generator
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/rwth-acis/openapi-link-generator/CI)
![npm](https://img.shields.io/npm/v/openapi-link-generator)
![License](https://img.shields.io/github/license/rwth-acis/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]
```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 --
```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 --
```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
```