GithubHelp home page GithubHelp logo

helitik / yamlinc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from javanile/yamlinc

0.0 0.0 0.0 154 KB

Compose multiple YAML files into one with $include tag, split Swagger/OpenAPI into multiple YAML files.

License: MIT License

JavaScript 100.00%

yamlinc's Introduction

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 appends '*.inc.yml' extension to compiled file.

Development watcher

During development you need constantily updated compiled file by watching changes of dependencies

$ yamlinc --watch spectacle -d my_swagger_doc.yml

This example generates documentation with spectacle

Feed your .inc.yml file

If your application needs a compiled file as parameter you can simply compound and feed

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

Redirect output to another command

If your application needs send output to another command or chaining using pipe follow this example

$ yamlinc --output - input.yml | nc seashells.io 1337

Parse files to find syntax errors

If your application needs stop after a syntax error or missing file inclusion use strict mode

$ yamlinc --strict settings.yml

Use an external schema

If you have your own or a third party schema you can pass it to yamlinc like this

$ yamlinc --schema ../node_modules/cloudformation-schema-js-yaml

Create your scenario

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

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

yamlinc's People

Contributors

francescobianco avatar helitik avatar justinnichols avatar stefancarlton avatar zaijo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.