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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Masaki Iino
November 17, 2017
Technology
0
740
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
580
Other Decks in Technology
See All in Technology
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.2k
20260129_CB_Kansai
takuyay0ne
1
230
AI時代、1年目エンジニアの悩み
jin4
1
130
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
430
2026年はチャンキングを極める!
shibuiwilliam
8
1.7k
入社1ヶ月でデータパイプライン講座を作った話
waiwai2111
1
200
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
170
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
1
240
メルカリのAI活用を支えるAIセキュリティ
s3h
7
5.4k
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
1
170
それぞれのペースでやっていく Bet AI / Bet AI at Your Own Pace
yuyatakeyama
1
680
Amazon ElastiCacheのコスト最適化を考える/Elasticache Cost Optimization
quiver
0
310
Featured
See All Featured
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
The Cult of Friendly URLs
andyhume
79
6.8k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
60
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
50
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
130
Un-Boring Meetings
codingconduct
0
200
The untapped power of vector embeddings
frankvandijk
1
1.6k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
630
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Testing 201, or: Great Expectations
jmmastey
46
8k
Designing for humans not robots
tammielis
254
26k
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 でタイポも防げる • 楽できる