All Projects → WindomZ → Swagger Merger

WindomZ / Swagger Merger

Licence: mit
🔗 Merge multiple swagger files into a swagger file, support JSON/YAML.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Swagger Merger

Api Client Generator
Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
Stars: ✭ 92 (-2.13%)
Mutual labels:  swagger, json, yaml
Swagger Express Ts
Generate and serve swagger.json
Stars: ✭ 102 (+8.51%)
Mutual labels:  swagger, swagger2, json
Cli
A simple, fast, and fun package for building command line apps in Go
Stars: ✭ 16,995 (+17979.79%)
Mutual labels:  cli, json, yaml
Oq
A performant, and portable jq wrapper to facilitate the consumption and output of formats other than JSON; using jq filters to transform the data.
Stars: ✭ 132 (+40.43%)
Mutual labels:  cli, json, yaml
Django Rest Swagger Docs
Beginners approach to Django Rest Swagger
Stars: ✭ 86 (-8.51%)
Mutual labels:  swagger, swagger2, yaml
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (+100%)
Mutual labels:  cli, json, yaml
Kaizen Openapi Editor
Eclipse Editor for the Swagger-OpenAPI Description Language
Stars: ✭ 97 (+3.19%)
Mutual labels:  swagger, json, yaml
Vcspull
🔄 synchronize projects via yaml/json manifest. built on libvcs
Stars: ✭ 187 (+98.94%)
Mutual labels:  cli, json, yaml
Swaggen
OpenAPI/Swagger 3.0 Parser and Swift code generator
Stars: ✭ 385 (+309.57%)
Mutual labels:  swagger, cli, yaml
Tmuxp
💻 tmux session manager. built on libtmux
Stars: ✭ 3,269 (+3377.66%)
Mutual labels:  cli, json, yaml
Yq
Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
Stars: ✭ 1,688 (+1695.74%)
Mutual labels:  cli, json, yaml
Structured Text Tools
A list of command line tools for manipulating structured text data
Stars: ✭ 6,180 (+6474.47%)
Mutual labels:  cli, json, yaml
Swurg
Parse OpenAPI documents into Burp Suite for automating OpenAPI-based APIs security assessments (approved by PortSwigger for inclusion in their official BApp Store).
Stars: ✭ 94 (+0%)
Mutual labels:  swagger, json, yaml
Swagger Toolbox
💡 Swagger schema model (in yaml, json) generator from json data
Stars: ✭ 194 (+106.38%)
Mutual labels:  swagger, json, yaml
Remarshal
Convert between CBOR, JSON, MessagePack, TOML, and YAML
Stars: ✭ 421 (+347.87%)
Mutual labels:  cli, json, yaml
Dasel
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Stars: ✭ 759 (+707.45%)
Mutual labels:  cli, json, yaml
Spring Boot Webflux Swagger Starter
An example project to illustrate how to document Spring Boot Webflux with Swagger2
Stars: ✭ 62 (-34.04%)
Mutual labels:  swagger, swagger2
Re Txt
converts text-formats from one to another, it is very useful if you want to re-format a json file to yaml, toml to yaml, csv to yaml, ... etc
Stars: ✭ 59 (-37.23%)
Mutual labels:  json, yaml
Python Training For Network Engineers
Python hands-on training for network engineers. How to automate Junos with Python
Stars: ✭ 92 (-2.13%)
Mutual labels:  json, yaml
Http Prompt
An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
Stars: ✭ 8,329 (+8760.64%)
Mutual labels:  cli, json
┌─┐┬ ┬┌─┐┌─┐┌─┐┌─┐┬─┐   ┌┬┐┌─┐┬─┐┌─┐┌─┐┬─┐
└─┐│││├─┤│ ┬│ ┬├┤ ├┬┘───│││├┤ ├┬┘│ ┬├┤ ├┬┘
└─┘└┴┘┴ ┴└─┘└─┘└─┘┴└─   ┴ ┴└─┘┴└─└─┘└─┘┴└─

Greenkeeper badge Build Status Coverage Status Dependency Standard - JavaScript Style Guide License

Merge multiple swagger files into a swagger file, support JSON/YAML.

NPM

swagger-merger status

Features

  • [x] Merge multiple swagger files into a swagger file.
  • [x] $ref - A tag, include a single-level of swagger file.
  • [x] $ref#* - A tag, include a multi-level of swagger file.
  • [x] Support JSON/YAML swagger files(.json/.yaml/.yml).
  • [x] CLI - Command line interface.

Usage

$ref

Includes a single-level of swagger file.

For example:

$ref: "./host.yaml"
parameters:
  - $ref: "./name.yaml"
  - $ref: "./year.yaml"
  - $ref: "./age.yaml#/alex/son"
remote:
  $ref: "https://raw.githubusercontent.com/WindomZ/swagger-merger/remote.yaml#/name"
responses:
  $ref: "./responses.yaml#/post"

$ref#*

Includes a multi-level of swagger file.

  • Non-standard, suggest you use it for yourself
  • Instead of $ref, can be used side by side and not an array

For example:

paths:
  $ref#pets: "./paths/pets.yaml"
  $ref#pets-id: "./paths/pets-id.yaml"
definitions:
  $ref#pets: "https://raw.githubusercontent.com/WindomZ/swagger-merger/pets.yaml"
  $ref#error: "https://raw.githubusercontent.com/WindomZ/swagger-merger/error.yaml"

CLI

How to use?

$ swagger-merger -h

  Usage: swagger-merger [-h] [-v] [-c] [-o file] <-i file | file>

  Merge multiple swagger files into a swagger file, just support JSON/YAML.

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    -i, --input <file>   input a main/entry JSON/YAML swagger file
    -o, --output <file>  output a merged JSON/YAML swagger file, default is `swagger.*`
    -c, --compact        compact JSON/YAML format string
    --debug              debug mode, such as print error tracks

Easy to use.

swagger-merger -i in.yaml                # Merge in.yaml into swagger.yaml
swagger-merger -i in.yaml -o out.yaml    # Merge in.yaml into out.yaml
swagger-merger -i in.yaml -o out.yaml -c # Merge in.yaml into out.yaml and compress it
swagger-merger -i in.yaml -o out.json    # Merge in.yaml into out.json

swagger-merger -i in.json                # Merge in.json into swagger.json
swagger-merger -i in.json -o out.json    # Merge in.json into out.json
swagger-merger -i in.json -o out.json -c # Merge in.json into out.json and compress it
swagger-merger -i in.json -o out.yaml    # Merge in.json into out.yaml

Install

npm install swagger-merger -g

Examples

It would be more helpful to see these examples.

Open the terminal, choose one of the following ways:

  • npm

    npm install
    npm run test
    
  • yarn

    yarn
    yarn run test
    
  • swagger-merger (installed, go to each examples)

    swagger-merger -i index.yaml
    swagger-merger -i index.json
    

Then, these examples may help you:

heroku-pets

  • Official swagger example
  • No modification

Go to example/heroku-pets

  1. The output swagger.json is same as the expected heroku-pets.json.
  2. The output swagger.yaml is similar to the expected heroku-pets.yaml.

echo

  • Base on official swagger example
  • Modify to support for $ref tags

Go to example/echo

  1. The output swagger.json is same as the expected echo.json.
  2. The output swagger.yaml is similar to the expected echo.yaml.

petstore_simple

  • Base on official swagger example
  • Modify to support for $ref#* tags

Go to example/petstore_simple

  1. The output swagger.json is same as the expected petstore_simple.json.
  2. The output swagger.yaml is similar to the expected petstore_simple.yaml.

petstore_domain

A way of using $ref instead of $ref#*, and better compatibility.

  • Same as petstore_simple
  • Modify to support for $ref tags
  • Modify to support for multiple levels schema

Go to example/petstore_domain

  1. The output swagger.json is same as the expected petstore_simple.json.
  2. The output swagger.yaml is similar to the expected petstore_simple.yaml.

Contributing

Welcome to pull requests, report bugs, suggest ideas and discuss swagger-merger, i would love to hear what you think about swagger-merger on issues page.

If you like it then you can put a ⭐️ on it.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].