44
39

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 5 years have passed since last update.

Swaggerから静的HTMLを生成する

Posted at

Swaggerから静的(Webサーバ不要でローカルに保存したファイルをブラウザで開いて表示できる)HTMLを生成する方法を調べました。

(1) redoc-cli

redoc-cli を使うとコマンドラインでSwaggerファイルを静的HTMLに変換できる。

インストール

npm install -g redoc-cli

静的HTML生成

redoc-cli bundle [Swaggerファイル]

(2) Swagger-UI

SwaggerUIBundleのspecプロパティにJSON形式のSwaggerオブジェクトを渡すことで、静的HTMLを作成できる。

参考

44
39
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
44
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?