https://github.com/marcelthole/openapi-merge
https://github.com/marcelthole/openapi-merge
hacktoberfest openapi openapi3
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcelthole/openapi-merge
- Owner: marcelthole
- License: mit
- Created: 2020-10-23T22:26:31.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-05-19T12:10:07.000Z (8 months ago)
- Last Synced: 2025-07-15T13:53:17.551Z (7 months ago)
- Topics: hacktoberfest, openapi, openapi3
- Language: PHP
- Homepage:
- Size: 140 KB
- Stars: 16
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAPI Merge
[](https://github.com/marcelthole/openapi-merge/actions)
[](https://github.com/marcelthole/openapi-merge/actions)
[](https://codecov.io/gh/marcelthole/openapi-merge)
[](https://dashboard.stryker-mutator.io/reports/github.com/marcelthole/openapi-merge/main)
[](//packagist.org/packages/marcelthole/openapi-merge)
[](//packagist.org/packages/marcelthole/openapi-merge)
Read multiple OpenAPI 3.0.x YAML and JSON files and merge them into one large file.
This application is build on [cebe/php-openapi](https://github.com/cebe/php-openapi)
# Installation
```
composer require marcelthole/openapi-merge
```
# Usage
## CLI
```
$ vendor/bin/openapi-merge --help
Usage:
openapi-merge basefile.yml additionalFileA.yml additionalFileB.yml [...] > combined.yml
```
### Arguments
| Argument | Meaning |
| --- | --- |
| --match[=MATCH] | Use a RegEx pattern to determine the additionalFiles. If this option is set the additionalFiles could be omitted (multiple values allowed) |
| --resolve-references[=RESOLVE-REFERENCES] | Resolve the "$refs" in the given files [default: true] |
| -o, --outputfile[=OUTPUTFILE] | Defines the output file for the result. Defaults the result will printed to stdout |
## Docker
Run the `openapi-merge` command within a docker container
```
docker pull ghcr.io/marcelthole/openapi-merge
docker run -v $PWD:/app --rm ghcr.io/marcelthole/openapi-merge [arguments]
```
Build the image locally from the sourcecode:
```
docker build --build-arg COMPOSER_REQUIRE_VERSION= --no-cache -t marcelthole/openapi-merge:dev docker
docker run -v $PWD:/app --rm marcelthole/openapi-merge:dev [arguments]
```
## Outputformat
The output format is determined by the basefile extension.