Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GolangでAPIドキュメント自動生成
Search
Masaki Iino
November 17, 2017
Technology
770
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GolangでAPIドキュメント自動生成
社内LT
Masaki Iino
November 17, 2017
More Decks by Masaki Iino
See All by Masaki Iino
GCP Composer
iinomasaki
0
270
AnyPay ChatOps
iinomasaki
0
1.2k
Istio
iinomasaki
0
1.7k
LT_Cloud_Functions.pdf
iinomasaki
1
600
Other Decks in Technology
See All in Technology
(swiftc) NonCopyableとライフタイム修飾子
teamhimeh
0
130
AI時代のGraphQL
joere
3
410
Adversary Infrastructure Hunting101
disconinja
0
160
小規模OSSモデルは サイバーセキュリティ業務に どこまで使えるか
bbrbbq
0
300
Claude Codeから見る、エンジニアの世界の変容とその先
oikon48
6
4.3k
Obsidian Vault Architectures
x5gtrn
PRO
0
160
ドメインエキスパートは いかにして AI を使って プロダクト開発をするか
tatsuyashiraishi
1
200
LLM Content Moderationを支える評価・改善ループの実践
suikabar
2
360
Claude Code をローカルとサーバー上で利用した際の Bedrock 利用料をユーザー単位で一本化してみる
ohorig
0
160
Filter What the LLM Reads: RAG Governance with AgentCore Gateway
yakumo
0
110
FinOps Agentが生んだ技術負債:コスト自動調査の落とし穴と解消までの道のり
oasis1994liveforever
3
300
freeeにおけるSoftware Factory
freee
PRO
0
530
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
580
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
500
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Between Models and Reality
mayunak
4
510
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
950
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
610
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Producing Creativity
orderedlist
PRO
348
41k
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 でタイポも防げる • 楽できる