Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GolangでAPIドキュメント自動生成
Search
Masaki Iino
November 17, 2017
Technology
0
730
GolangでAPIドキュメント自動生成
社内LT
Masaki Iino
November 17, 2017
Tweet
Share
More Decks by Masaki Iino
See All by Masaki Iino
GCP Composer
iinomasaki
0
250
AnyPay ChatOps
iinomasaki
0
1.2k
Istio
iinomasaki
0
1.6k
LT_Cloud_Functions.pdf
iinomasaki
1
570
Other Decks in Technology
See All in Technology
Error.prototype.stack の今と未来
progfay
1
190
単一Kubernetesクラスタで実現する AI/ML 向けクラウドサービス
pfn
PRO
1
340
米軍Platform One / Black Pearlに学ぶ極限環境DevSecOps
jyoshise
2
520
自然言語でAPI作業を片付ける!「Postman Agent Mode」
nagix
0
110
SRE視点で振り返るメルカリのアーキテクチャ変遷と普遍的な考え
foostan
2
410
ZOZOTOWNカート決済リプレイス ── モジュラモノリスという過渡期戦略
zozotech
PRO
0
490
Post-AIコーディング時代のエンジニア生存戦略
shinoyu
0
300
LINEギフト・LINEコマース領域の開発
lycorptech_jp
PRO
0
340
雲勉LT_Amazon Bedrock AgentCoreを知りAIエージェントに入門しよう!
ymae
2
170
DDD x Microservice Architecture : Findy Architecture Conf 2025
syobochim
12
3.1k
Moto: Latent Motion Token as the Bridging Language for Learning Robot Manipulation from Videos
peisuke
0
160
なぜThrottleではなくDebounceだったのか? 700並列リクエストと戦うサーバーサイド実装のすべて
yoshiori
13
4.9k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
Designing for humans not robots
tammielis
254
26k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.3k
Context Engineering - Making Every Token Count
addyosmani
9
410
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
How STYLIGHT went responsive
nonsquared
100
5.9k
Transcript
GolangでAPIドキュメント自動 生成 2017/11/17 飯野 雅希
APIドキュメント書いてますか?
APIドキュメントは書くのが大変 • Host • Path • HTTPメソッド • Request Header,
Body • Query Parameter • Response Status Code • Response Header, Body • etc...
書き手と読み手が違う • 書くのはサーバーエンジニア • 読むのはフロント・クライアントエンジニア
APIドキュメンテーションツール • Swagger • apiblueprint
API Blueprint • Markdownを使って定義を書く ◦ 拡張子は.apib • Markdownそのままでも読みやすい
API Blueprint • 基本情報 ◦ タイトル ◦ ホスト • グループ
• endopoint情報 ◦ HTTPメソッド ◦ endpoint ◦ リクエスト ◦ パラメータ ◦ レスポンス
読みやすく高機能
だけど、手書きで管理し続けるのは大変
ドキュメントを自動生成しよう 要件 • Golangでコード書いたらapiblueprintでドキュメント自動生成 • apibファイルだとviewerがいるので、HTMLに変換
apiblueprint生成 test2doc:https://github.com/adams-sarah/test2doc • GolangのPackage • Star 236 • Unitテストと組み合わせると自動でAPIドキュメントを生成してくれる
test2doc
test2doc
HTMLに変換 Gulpスクリプトで変換 https://storage.googleapis.com/iino-test-api-doc-test/out.html
所感 • 自動で生成されるのでコードとドキュメントの乖離がなくなる • Go lint/vet でタイポも防げる • 楽できる