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
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.yamlsee convert example example/openapi.yaml -> example/openapi.yaml
$ 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
...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
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