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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
150
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
160
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
260
空間オーディオで過去の 自分(ゴースト)と競うランニング 〜HealthKitのルートを足音に変える実装〜
nao_randd
0
220
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
490
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
29
24k
AI de Idea
kawaguti
PRO
2
110
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
140
人間はどの意思決定を手放せるのか
kawasima
14
6.9k
Railsのように考える: See through the Master
snoozer05
PRO
3
880
LLMに渡さなかった仕事
nanaism
0
170
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
870
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
420
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Code Review Best Practice
trishagee
74
20k
Design in an AI World
tapps
1
320
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Visualization
eitanlees
152
17k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
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 でタイポも防げる • 楽できる