in-house-swagger / in-house-swagger

in-house swagger-tools server

Home Page:https://in-house-swagger.github.io/in-house-swagger/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

swagger-spec-mgrをmodulesに追加

suwa-sh opened this issue · comments

ストーリー

利用者 として
swagger.yamlをバージョン管理 するために、
swagger-spec-mgrを利用 できる。

背景・経緯

swagger-editor で編集したswagger.yamlは、browserのlocalstorageに保存されるだけ
importする機能はあるが、swagger.yamlをどこで管理するかは任意なので
デフォルトの管理場所を用意する。

swagger.yamlは本格的に利用すると、大きなファイルになってしまう。
定義内容を構造体ごとに分割して、git管理したい。
local repository のみ、remoteあり(github/gitlabなど)は設定で切り替えたい。

受け入れ条件

  1. 他モジュールと同様に installで自動ダウンロード できること
  2. 他モジュールと同様に server で起動/停止を制御 できること

spec-mgrが別ポートで起動するので、swagger-editor デフォルトのimprtURLだと下記のエラーになる。
どう対応するか検討した方が良さそう。

Fetch API cannot load http://localhost:8081/v1/specs/default. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

spec-mgrにCORS設定を追加。
追加後のバージョンを組み込む。