API仕様書をAPI Blueprintで書く

便利なものはどんどん使っていこうね〜

API Blueprint

書いてみた

FORMAT: 1A HOST: http:/api.tap.shmn7iii.net # Tap API Document **REST API for Tap!** [**Tap!** - Rakuchin NFT issuing service -](https://tap.shmn7iii.net) [**Tap-Team/tap-api** - GitHub](https://github.com/Tap-Team/tap-api) ## Usage REST APIのイメージで作ってるからその感じで。 ::: warning ### Caution チームメンバー向けに書いてるだけだよ公開する意図はないよ ::: # Group TapUser ### 一覧 [GET /users] ユーザーの一覧を表示する。 ::: note ## Note 使い所ありませんデバッグ用です。 ::: + Response 200 + Body ``` { "status": "200", "message": "Success! users#index", "data": "IIKANNZI_NI_KAETTE_KURUYO" } ``` + Response 500 + Body ``` { "status": "500", "message": "Internal Server Error", "data": "(error message)" } ``` ### 登録 [POST /users] 新規ユーザを登録する + Request (application/json) + Body ``` { "uid": "KOKO_NI_UID_WO_IRERU_YO", "message": "Success! users#create", "data": "No contents" } ``` + Response 200 + Body ``` { "status": "200", "message": "Success! users#create", "data": "No contents" } ``` + Response 500 + Body ``` { "status": "500", "message": "Internal Server Error", "data": "(error message)" } ``` ### 更新 [PUT /users ] ユーザーを更新する。 ::: note ## Note 使い所ありませんデバッグ用です。 ::: + Request (application/json) + Body ``` { "uid": "KOKO_NI_UID_WO_IRERU_YO", "wallet_id": "KOKO_HA_WALLET_ID_WO_IRERU_YO" } ``` + Response 200 + Body ``` { "status": "200", "message": "Success! users#update", "data": "No contents" } ``` + Response 500 + Body ``` { "status": "500", "message": "Internal Server Error", "data": "(error message)" } ``` ### 削除 [DELETE /users/{uid} ] ユーザーを削除する + Parameters + uid: `9ao4s2L120RiGkKwJEKojL5uw7H1` (required, string) - Firabase Auth's uid. + Response 200 + Body ``` { "status": "200", "message": "Success! users#delete", "data": "No contents" } ``` + Response 500 + Body ``` { "status": "500", "message": "Internal Server Error", "data": "(error message)" } ```
api_docment.apib

Aglio

HTML生成とリアルタイム編集をしてくれる。便利。

インストール
$ npm install -g aglio
リアルタイム編集
$ aglio -i api_docment.apib -s

3000ポートで開けるようになる。

HTML生成
$ aglio -i api_docment.apib -o api_docment.html

参考