0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

OpenAPIの分割したスキーマファイルを結合する

Posted at

1. はじめに

  • OpenAPI用スキーマファイルが肥大化したため、$refで外部ファイル化したものを1ファイルに結合したい
  • node.jsをインストールしてnpm経由でswagger-cliを取得して実行したい

2. node.jsのインストール

  • npmを使用してインストールするためnode.jsをインストールする

2.1. node.jsのダウンロードサイトを開く

2.2. インストーラーをダウンロードする

image.png

2.3. インストーラーを実行する

image.png

2.4. Nextボタンをクリックする

image.png

2.5. チェックボックスをONにしてNextボタンをクリックする

image.png

2.6. Nextボタンをクリックする

image.png

2.7. Nextボタンをクリックする

image.png

2.8. Nextボタンをクリックする

image.png

2.9. Installボタンをクリックする

image.png

2.10. Finishボタンをクリックする

image.png

2.11. パソコンを再起動する

3. swagger-cliのインストール

3.1. コマンドプロンプトを起動する

image.png

3.2. node.jsのインストールを確認する

node --version
image.png

3.3. swagger-cliをインストールする

npm install -g @apidevtools/swagger-cli
image.png

4. スキーマファイルの統合

swagger-cli bundle -o ./.gen_api_schema/openapi.yaml -t yaml ./openapi.yaml

  • -o : 結合したスキーマファイルの出力先(結合後)
  • -t: ファイル形式(YAML形式を選択)
  • : 分割したスキーマファイル(結合前)

5. 参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?