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
APIドキュメントにまつわる試行錯誤 #gotandajs
Search
mizuki_r
September 02, 2016
Technology
1
880
APIドキュメントにまつわる試行錯誤 #gotandajs
2016-09-02 Gotanda.js #5 の発表資料
mizuki_r
September 02, 2016
Tweet
Share
More Decks by mizuki_r
See All by mizuki_r
FrontendUp_新規事業で_Remixを採用した理由と対策.pdf
rymizuki
0
220
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
280
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
770
モダンとレガシー #gotandaem
rymizuki
0
580
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
140
DockerでNodeの開発は厳しいのか? #gotandajs
rymizuki
3
400
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.8k
物語を楽しむための物語論
rymizuki
0
530
失敗と向き合う
rymizuki
0
1.5k
Other Decks in Technology
See All in Technology
投資戦略を量産せよ 2 - マケデコセミナー(2025/12/26)
gamella
0
500
AIBuildersDay_track_A_iidaxs
iidaxs
4
1.5k
202512_AIoT.pdf
iotcomjpadmin
0
150
AR Guitar: Expanding Guitar Performance from a Live House to Urban Space
ekito_station
0
260
Agentic AIが変革するAWSの開発・運用・セキュリティ ~Frontier Agentsを試してみた~ / Agentic AI transforms AWS development, operations, and security I tried Frontier Agents
yuj1osm
0
100
_第4回__AIxIoTビジネス共創ラボ紹介資料_20251203.pdf
iotcomjpadmin
0
140
日本の AI 開発と世界の潮流 / GenAI Development in Japan
hariby
2
570
Keynoteから見るAWSの頭の中
nrinetcom
PRO
1
100
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
130
7,000万ユーザーの信頼を守る「TimeTree」のオブザーバビリティ実践 ( Datadog Live Tokyo )
bell033
1
110
Redshift認可、アップデートでどう変わった?
handy
1
100
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
200
Featured
See All Featured
Believing is Seeing
oripsolob
0
16
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.2k
How to Talk to Developers About Accessibility
jct
1
87
AI: The stuff that nobody shows you
jnunemaker
PRO
1
29
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
320
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.8k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
260
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
120
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Code Reviewing Like a Champion
maltzj
527
40k
Transcript
APIドキュメントにまつわる 試行錯誤 2016/09/02 Gotanda.JS #5 @mizuki_r
@mizuki_r (株)モバイルファクトリー フロントエンドエンジニア JS, Perl Angular, Vue, Riot “HTMLは情報設計言語です!” 2
本日のお題 3
APIドキュメントにまつわる 試行錯誤
――を妄想している、 という話をします。
背景
最近の開発スタイル ʘUIϑΝʔετʗ ཁ݅ UI API ϞοΫ API αʔ ό ʔ
·ͣUI ใΛཧ͠ αʔόΛ ࡞Γ UIʹө͢Δ
最近の開発スタイル • ϑϩϯτerͰAPIϞοΫΛ࡞Δ • αʔόerϞοΫΛݩʹAPIΛ࡞Δ ʘAPIϞοΫͱ͍͏ίϛϡχέʔγϣϯπʔϧʗ
ユーザに対して どういう価値を提供するか? を土台に作れる! (๑•̀Ŷ•́๑)✧
悩み
モックの例 (&5BQJVTFSVTFS@OBNF ݸਓใΛͱͬͯ͘Δ \ OBNFʠVTFS@OBNFʡ BHF ^ ʘJSON5ʗ
よくあること • APIϞοΫͱαʔόͷϨεϙϯε͕ζϨΔ • POSTͷϦΫΤετύϥϝʔλ͕Θ͔Βͳ͍ • Ωʔ͕ԿΛ͍ࣔͯ͠Δͷ͔Θ͔Βͳ͍ • ফ͑ͨͣͷ༷͕ίϝϯτʹ͍ͬͯΔ ʘυΩϡϝϯςʔγϣϯෆʂʗ
問題… • ࡞ऀʹ༷Λ֬ೝ͢Δ • ίʔυΛಡΉ • ࣏͢… ʘ͜ɺίϛϡχέʔγϣϯπʔϧʂʗ
ツールで解決
API-Blueprint • MarkdownϕʔεͰυΩϡϝϯτΛهड़Ͱ͖ Δ • ύʔαʔΛఏڙ͠ɺ༷ʑͳ֦ு͕͋Δ
API-Blueprint • https://apiblueprint.org/ • MarkdownϕʔεͰυΩϡϝϯτΛهड़Ͱ͖ Δ • ύʔαʔΛఏڙ͠ɺ༷ʑͳ֦ு͕͋Δ
API-Blueprint
with Tools • aglio - HTMLʹυΩϡϝϯτΛܗ͢Δ • hariko - ϞοΫαʔόΛ্ཱͪ͛Δ
with Tools ཁ݅ UI API Blueprint API αʔ ό ʔ
UIΛઃܭ ใΛཧ αʔόͷߏங UIʹө API υΩϡϝϯτ API ϞοΫ ࣗಈੜ
解決できそう • ༷Λ໌จԽͰ͖Δ • ॻ͍ͨͷ͕ͦͷ··ಈ࡞͢Δ • ͕ٙ͋ͬͨΒه͢Ε͍͍ʂ ʘίϛϡχέʔγϣϯπʔϧʂʗ
でも…
問題は残る… • αʔόͱϞοΫͷ࣮ࠩ • API-Blueprintͷେͳ༷ • ֶशίετɺϝϯςίετ ʘӡ༻͕ΊΜͲͦ͘͞͏ʗ
妄想 • ͏Ұཉ͍͠ • αʔόͱͷ࣮ࠩΛิͰ͖Δ • ֶशίετʹݟ߹͏ޮԽ͕Ͱ͖Δ
あっ (゚∀゚)!
API-Blueprintのデータで Controllerくらいなら 作れんじゃね? (゚∀゚)!!
人類はどこまで 自動化できるのか〜?
API-Blueprintから取れるもの • ز͔ͭͷσʔλͷωετߏ • category, resource, action,transaction,httpTransaction,httpRequest,ht tpResponse,etc…
Controllerが要求するもの • ϦΫΤετͷஅ • Method, URL, Parameters • ॲཧͷஅ •
Modelͱ͔Serviceͷ໊લۭؒ • Ϩεϙϯεߏ • HttpStatus, Body, Header
use Amon2::Lite; use JSON::Types; get '/api/user/:user_name' => sub { my
($c, $args) = @_; my $params = $c->req->parametes; my %args = map { $_ => $params->{$_} or $args->{$_} } qw(user_name); my $entity = $c->factory('User')->get(%args); return $c->render_json(+{ name => string($entity->name), age => number($entity->age), }); }; __PACKAGE__->to_app;
(SPVQ6TFS (&5BQJVTFS\VTFS@OBNF^ 1BSBNFUFST VTFS@OBNF TUSJOH ʜϢʔβͷࣝผࢠ 3FTQPOTF BQQMJDBUJPOKTPO #PEZ
OBNF TUSJOH Ϣʔβͷࣝผࢠ BHF OVNCFS ྸ #PEZ \ OBNFʠNJ[VLJʡ BHF ^
ͳΜ͔ɺ Πέͦ͏ͳؾ͕͢Δʜ
DEMO https://gist.github.com/rymizuki/ab99a288dfafa841983182eddc0408c9
まとめ
まとめ • API-Blueprint with aglio x hariko x ??? •
API-BlueprintΛ༻͍ͨίʔυͷࣗಈੜ
所感 • υΩϡϝϯτͱϞοΫͱίʔυ͕࿈ಈ • ཧ্࠷ڧ • Ζ͏ͱࢥ͑ߦ͚Δ • ͰͦͷྔʹνʔϜ͍ͭͯ͜ΕΔ͔…? •
ߟྀ͢Δ͜ͱ͕߹ͤരൃͯ͠ࢮʹͦ͏…
やるなら 有効そう な無茶をしましょう!
ご清聴ありがとうございまし た