Skip to content
/ yamlinc Public
forked from javanile/yamlinc

Split Swagger/OpenAPI into multiple YAML files

License

Notifications You must be signed in to change notification settings

Zaijo/yamlinc

 
 

Repository files navigation

Yamlinc

Create a composed YAML file using $include tag.

NPM

Build Status Test Coverage Maintainability

Simple usage

STEP #1 - Install global yamlinc command-line utility

$ npm install -g yamlinc

STEP #2 - Create "my_swagger_doc.yml" and split it into multiple file

## file: my_swagger_doc.yml
version: '2.0'
$include: ./tags.yml
$include: ./paths.yml
## file: tags.yml
tags:
- FirstTag
- SecondTag
## file: paths.yml
paths:
  /api/me:
    get: ...      
  /api/you:
    post: ...
  $include: others-paths.yml
## file: others-paths.yml
/api/other/one:
  get: ...      
/api/other/two:
  post: ...

STEP #3 - Simply compile the entry point 'my_swagger_doc.yml'

$ yamlinc my_swagger_doc.yml

STEP #4 - Get your compiled file 'my_swagger_doc.inc.yml'

NOTICE: Yamlinc append '*.inc.yml' extension to compiled file.

Development watcher

During development you need costantily updated compiled file by watching changes of dependences

$ yamlinc --watch spectacle -d my_swagger_doc.yml

Feed your .inc.yml file

If your application need a copiled file as parameter you simple compound and feed

$ yamlinc --exec docker-compose -f docker-compose.yml

Create your scenario

If you have custom scenario with YAML file please place an issues on the follow page

https://github.com/javanile/yamlinc/issues/new

About

Split Swagger/OpenAPI into multiple YAML files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%