tur

Create a composed YAML file using $include tag.

Usage no npm install needed!

<script type="module">
  import tur from 'https://cdn.skypack.dev/tur';
</script>

README

Yamlinc

Create a composed YAML file using $include tag.

Build Status Test Coverage Maintainability

Simple usage

  1. Install global tur command-line utility
$ npm install tur -g
  1. 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: ...
  1. Simply compile the entry point 'my_swagger_doc.yml'
$ tur my_swagger_doc.yml
  1. Get your compiled file 'my_swagger_doc.inc.yml'

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

Develompment watcher

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

$ tur --watch spectacle -d my_swagger_doc.yml