Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanmen/openapi-yaml
https://github.com/tanmen/openapi-yaml
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tanmen/openapi-yaml
- Owner: tanmen
- Created: 2020-08-14T12:19:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-26T21:37:59.000Z (over 4 years ago)
- Last Synced: 2024-05-02T05:16:32.037Z (8 months ago)
- Language: TypeScript
- Size: 168 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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`C.yml`
```yaml
example: Example
````output $dir`
```javascript
{
A: {
B: {
C: {
example: 'Example'
}
}
}
}
```### Special notation
`@` Is used as a special character in this library.
`file structure`
- A
- @B
- C.yml`C.yml`
```yaml
example: Example
````output $dir`
```javascript
{
A: {
'/B': {
C: {
example: 'Example'
}
}
}
}
```## Cli options
```shell script
openapi-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`
```shell script
yarn add -D openapi-yaml
```
`npm`
```shell script
npm install -D openapi-yaml
```#### usage
`cli`
```shell script
openapi-yaml ./main.yml -o ./merged.yml
```### docker
```shell script
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