openapi-yaml
v1.1.3
Published
This library manages a split openapi yaml file.
Downloads
5
Readme
openapi-yaml
This library manages a split openapi yaml file.
Extended syntax
This library uses $dir
to manage split yaml files.
$dir
is a property that converts yml under the target directory to object according to the directory structure.
file structure
- A
- B
- C.yml
- B
C.yml
example: Example
output $dir
{
A: {
B: {
C: {
example: 'Example'
}
}
}
}
Special notation
@
Is used as a special character in this library.
file structure
- A
- @B
- C.yml
- @B
C.yml
example: Example
output $dir
{
A: {
'/B': {
C: {
example: 'Example'
}
}
}
}
Cli options
openapi-yaml <yaml> [options]
command
| name | required | type | description | | --------- | -------- | ------ | --------------------------------- | | yaml | true | String | Path of root yaml file |
options
| name | alias | required | type | description | | --------- | ----- | -------- | ------ | --------------------------------- | | output | o | true | String | Output Path of combined yaml file |
Get started
node
install
yarn
yarn add -D openapi-yaml
npm
npm install -D openapi-yaml
usage
cli
openapi-yaml ./main.yml -o ./merged.yml
docker
docker run --rm -v $(pwd):/home tanmen/openapi-yaml ./main.yml -o ./merged.yml
Issue
If you find a problem, please report it on Issue, and we will fix it.
Contributes
If you would like to cooperate with the development, please create a PR and participate.
License
MIT License