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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Masaki Iino
November 17, 2017
Technology
760
0
Share
GolangでAPIドキュメント自動生成
社内LT
Masaki Iino
November 17, 2017
More Decks by Masaki Iino
See All by Masaki Iino
GCP Composer
iinomasaki
0
260
AnyPay ChatOps
iinomasaki
0
1.2k
Istio
iinomasaki
0
1.7k
LT_Cloud_Functions.pdf
iinomasaki
1
590
Other Decks in Technology
See All in Technology
OpenID Connectによるサービス間連携
takesection
0
140
ポスター発表&デモと総括 / Poster Presentations & Demonstrations and Summary
ks91
PRO
0
160
インフラが苦手でも大丈夫! 紙芝居 Kubernetes -WWGT 10周年編-
aoi1
1
310
Fabric-cicd によるAzure DevOps デプロイ
ryomaru0825
0
140
Cloud Run のアップデート 触ってみる&紹介
gre212
0
240
テストコードのないプロジェクトにテストを根付かせる
tttol
0
230
A Harness for Behaviour: how to get AI to generate code that does what we intend, or "TDD in the age of AI"
xpmatteo
1
520
Sony_KMP_Journey_KotlinConf2026
sony
0
170
人が担う「価値」とは?これからの「QA」とは / Human Value and the Future of Quality Assurance
bitkey
PRO
0
140
Amazon Bedrock 経由の Claude Cowork を試してみよう・MCP にも繋いでみよう
sugimomoto
0
250
Diagnosing performance problems without the guesswork
elenatanasoiu
0
120
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Side Projects
sachag
455
43k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
160
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Done Done
chrislema
186
16k
Why Our Code Smells
bkeepers
PRO
340
58k
Designing for humans not robots
tammielis
254
26k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
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 でタイポも防げる • 楽できる