$30 off During Our Annual Pro Sale. View Details »
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
[Neurogica] 採用ポジション/ Recruitment Position
neurogica
1
110
20251222_サンフランシスコサバイバル術
ponponmikankan
2
140
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
1.4k
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
220
障害対応訓練、その前に
coconala_engineer
0
190
AI駆動開発の実践とその未来
eltociear
1
480
AWSの新機能をフル活用した「re:Inventエージェント」開発秘話
minorun365
2
440
Identity Management for Agentic AI 解説
fujie
0
450
ActiveJobUpdates
igaiga
1
310
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
120
子育てで想像してなかった「見えないダメージ」 / Unforeseen "hidden burdens" of raising children.
pauli
2
320
Building Serverless AI Memory with Mastra × AWS
vvatanabe
0
490
Featured
See All Featured
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
120
Deep Space Network (abreviated)
tonyrice
0
21
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
90
Context Engineering - Making Every Token Count
addyosmani
9
550
The #1 spot is gone: here's how to win anyway
tamaranovitovic
1
860
The Spectacular Lies of Maps
axbom
PRO
1
400
Designing Powerful Visuals for Engaging Learning
tmiket
0
190
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
170
How STYLIGHT went responsive
nonsquared
100
6k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
680
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 でタイポも防げる • 楽できる