0.3.1 • Published 2 years ago

openapi-combine v0.3.1

Weekly downloads
8
License
MIT
Repository
github
Last release
2 years ago

openapi-combine

test CI oclif Version Downloads/week License Docker Hub package

Features

Supports $ref Syntax and $refs Extended syntax
$ref supports based on rfc3986
The extended syntax of $refs is a syntax that can have $ref as an array

Extended syntax usage examples

Define multiple $ref references using $refs as shown below (Currently only Local Reference support)

openapi: "3.0.0"
info:
  version: 1.0.0
  title: examples
servers:
  - url: http://petstore.swagger.io/v1
paths:
  /pets/{petId}:
    $ref: ./paths/pets/id/index.yaml
components:
  schemas:
    $refs:
      - ./components/schemas/pet.yaml
      - ./components/schemas/pets.yaml
    Error:
      $ref: ./components/schemas/error.yaml

see convert example example/openapi.yaml -> example/openapi.yaml

Usage

$ npm install -g openapi-combine
$ openapi-combine COMMAND
running command...
$ openapi-combine (-v|--version|version)
openapi-combine/0.3.1 linux-x64 node-v16.15.0
$ openapi-combine --help [COMMAND]
USAGE
  $ openapi-combine COMMAND
...

Commands

openapi-combine help [COMMAND]

Display help for openapi-combine.

USAGE
  $ openapi-combine help [COMMAND]

ARGUMENTS
  COMMAND  Command to show help for.

OPTIONS
  -n, --nested-commands  Include all nested commands in the output.

See code: @oclif/plugin-help

openapi-combine merge

describe the command here

USAGE
  $ openapi-combine merge

OPTIONS
  -i, --input=input     (required) input target yaml file
  -o, --output=output   [default: ./output/openapi.yaml] output target yaml file
  -t, --type=yaml|json  [default: yaml] output format yaml or json

EXAMPLE
  $ openapi-combine merge -i ./example/openapi.yaml -o ./build/openapi.yaml