LoginSignup
0
3

More than 3 years have passed since last update.

OpenAPI Specificationを利用したAPI仕様作成フロー

Posted at

概要

自分がAPI仕様を作成するときのやり方をまとめる。

使うもの

  • Git, Github, Github Pages
  • Stoplight Studio
  • VSCode

手順

リポジトリ作成 & Swagger UIファイル取得

  • OpenAPI Specificationの表示用にSwagger UIファイル取得
  • https://github.com/swagger-api/swagger-ui のdistフォルダの中身が必要。
  • Github Pagesでdocsフォルダを公開予定なのでそこに入れる。
$ git clone git@github.com:swagger-api/swagger-ui.git
$ mkdir docs
$ cp -r swagger-ui/dist/* docs
$ rm -r swagger-ui

ドキュメントを書く

Swagger UIのデフォルトページを作成したAPIのものにする

ローカルで確認

mainブランチにマージするまでGithub Pagesに反映されないため、プルリク段階では別の手段での確認が必要。
VSCodeプラグインを利用。

プルリク

Github Pagesに展開

0
3
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
3