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
APIドキュメントにまつわる試行錯誤 #gotandajs
Search
mizuki_r
September 02, 2016
Technology
930
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
APIドキュメントにまつわる試行錯誤 #gotandajs
2016-09-02 Gotanda.js #5 の発表資料
mizuki_r
September 02, 2016
Transcript
37 slides
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Λ༻͍ͨίʔυͷࣗಈੜ
所感 • υΩϡϝϯτͱϞοΫͱίʔυ͕࿈ಈ • ཧ্࠷ڧ • Ζ͏ͱࢥ͑ߦ͚Δ • ͰͦͷྔʹνʔϜ͍ͭͯ͜ΕΔ͔…? •
ߟྀ͢Δ͜ͱ͕߹ͤരൃͯ͠ࢮʹͦ͏…
やるなら 有効そう な無茶をしましょう!
ご清聴ありがとうございまし た
More Decks by mizuki_r
See All by mizuki_r
FrontendUp_新規事業で_Remixを採用した理由と対策.pdf
rymizuki
0
270
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
330
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
890
モダンとレガシー #gotandaem
rymizuki
0
620
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
170
DockerでNodeの開発は厳しいのか? #gotandajs
rymizuki
3
440
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.9k
物語を楽しむための物語論
rymizuki
0
580
失敗と向き合う
rymizuki
0
1.6k
Other Decks in Technology
See All in Technology
NutanixへのSSHアクセスの今後について
shadowhat
0
160
共通基盤の実装に Kotlin - Quarkus を選定した理由と採用したアーキテクチャ
nealle
1
160
Agent Routerで作るマルチテナント 推論基盤 #CNDW2026 / Building Multi-Tenant Inference Platform with Agent Router #CNDW2026
everpeace
5
600
データから見る AI時代のエンジニア転職と採用
junya_okura
4
1.2k
IoTのデータ保存をSREの観点で考える
grimoh
1
120
ポケモンバトルのAIエージェント
koji_kawamura
0
150
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
エンタープライズ事業未経験のデータ屋、 AI時代にN回撃沈する.pdf
ryoskdara_
0
190
AIエージェントのアーキテクチャ設計
nsatoh
0
480
そのイメージ、どのCIが作った? Artifact Attestationsで来歴を固定する / Which CI system created that image? Pinning provenance with Artifact Attestations
chmikata
0
250
社内アプリ基盤「Quartz」による、 非エンジニアとAIに本番デプロイを 任せても壊れないプラットフォームの設計
staka121
PRO
1
220
常時稼働エージェントの作り方(Claude公式ブログを資料化)
minorun365
PRO
19
29k
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
Scaling GitHub
holman
464
140k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.9k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
630
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.8k
Why Our Code Smells
bkeepers
PRO
340
58k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
570
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
340