Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 1.43 KB

readme.md

File metadata and controls

36 lines (23 loc) · 1.43 KB

json-yaml-ref-resolver

npm version License: MIT

Simple $ref keyword resolver on json and yaml files.

Motivation

This app is mainly for merging split OpenApi(Swagger) files. Splitting API definitions into several files is human readable, but uniting definition files are required when defining APIs like AWS API Gateway. In addition, Swagger Editor is not supported $ref descriptions of remote references yet.

There are some $ref resolvers for json like this, but there doesn't seem to be them for yaml. So, I developed this app.

Installation

npm i -g json-yaml-ref-resolver

Usage

Please just specify a entry point file as <targetFilePath> and a merged file as <outputFilepath>.

ref-resolver [options] <targetFilePath> <outputFilePath>

Options:
  -i, --indent <size>  change indent size (default: 2)

This app simply expands all $ref descriptions and yaml references(* and & descriptions), so merged files become redundant.