Simple $ref
keyword resolver on json and yaml files.
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.
npm i -g json-yaml-ref-resolver
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.