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
SchemaDrivenDevelopment
Search
atomiyama
March 24, 2021
Technology
480
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SchemaDrivenDevelopment
atomiyama
March 24, 2021
More Decks by atomiyama
See All by atomiyama
Rustでgemを作ろう
atomiyama
0
1.7k
ffi & native extension
atomiyama
0
280
技術選定で失敗したはなし
atomiyama
0
1.4k
はじめてのDocker
atomiyama
0
120
Other Decks in Technology
See All in Technology
【データ横丁主催】AI エージェント時代のTranslytical Data Platform
shisyu_gaku
0
210
フィンテック養成勉強会#68
finengine
0
190
小規模OSSモデルは サイバーセキュリティ業務に どこまで使えるか
bbrbbq
0
170
20年間 SNS サービス「GREE」 を支えた技術の刷新と、長期運用サービスの Kubernetes へのリアーキテクト
gree_tech
PRO
0
110
Tofu-Controller lightning talk @ Containerday 2026
gionn
0
170
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
2
370
DBについての基礎説明(MySQL編) - コロプラ 2026年度 新卒研修
colopl
0
160
ガチで放置できるClaude Code実行環境の作り方.pdf
lamaglama39
0
2.6k
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
380
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
210
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
370
sue445's proposals 2026
sue445
0
130
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
142
7.8k
Navigating Team Friction
lara
192
16k
Believing is Seeing
oripsolob
1
250
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Thoughts on Productivity
jonyablonski
76
5.4k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
740
The World Runs on Bad Software
bkeepers
PRO
72
12k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
530
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Transcript
Copyright 2018 Studyplus, Inc. All Rights Reserved. OpenAPIΛ༻͍ͨεΩʔϚۦಈ։ൃ Akifumi Tomiyama
/ Studyplus Inc . 2021.03.24 @γϡʔϚΠʂ
ࣗݾհ ✎ 2018/09~ Studyplusೖࣾ ✎ 29ࡀ ✎ ؠखݝࡏॅ ✎ ͖ͳݴޠɿRuby,
Rust ࢁথ࢙ Akifumi Tomiyama atomiyama atomiyama1216 Studyplus Inc. ForSchool Dept. CX Product Group Team Lead.
ձࣾհ About Us
MISSION ʮֶͿتͼΛͯ͢ͷਓʯ ଟ͘ͷਓ͕StudyplusΛ௨ֶͯ͡शͷ͖͔͚ͬΛݟ͚ͭɺ ֶशΛָ͘͠ܧଓͰ͖Δ͜ͱΛ࣮ݱ͢Δɻ
ֶशهͷՄࢹԽͱɺಉ͡ඪΛࢦؒ͢ͱͷSNSͰϞνϕʔγϣϯΛܧଓͰ͖·͢ɻ ΞϓϦϨϏϡʔฏۉ4.5Ҏ্ɻGoogle Play2࿈ଓϕετΞϓϦɺຊe-Learningେʢ࠷༏लʣͳͲडଟɻ ʮຖͷษڧΛश׳ʹͰ͖ͳ͍ʯΈΛղܾ
ࢀߟॻಡΈ์ΞϓϦͷϙϧτɺ डݧੜʹਓؾͷࢀߟॻΛֹ݄980ԁʢ੫ผʣͰεϚϗͰಡΈ์ͷɺిࢠࢀߟॻͷαϒεΫϦϓγϣϯαʔϏεͰ͢ɻ ਓؾࢀߟॻΛεϚϗͰಡΈ์ͷɺిࢠࢀߟॻΞϓϦ
Studyplus for Schoolɺڭҭػֶ͚ؔशཧαʔϏεͰ͢ɻ ੜెͷʑͷྗΛɺؾ͖ͮɺ๙ΊΔػೳΛଟἧ͍͑ͯ·͢ɻ SNSͷΑ͏ͳૢ࡞ײͰɺ ୭Ͱ͙͢ʹ͍͡ΊΒΕ·͢ɻ ઌੜ͕ੜెΛ๙ΊΔػձΛ࠷େԽ͢Δɺֶशक़ͷ৽͍͠ελϯμʔυ
OpenAPIΛ༻͍ͨεΩʔϚۦಈ։ൃ Schema Driven Development
͢͜ͱ • OpenAPI 3.0ͱcommitteeΛͬͨ։ൃͷ • εΩʔϚۦಈ։ൃͷྲྀΕ • εΩʔϚϑΝΠϧཧ • ࠓ๊͍͑ͯΔ՝
Studyplus for SchoolͷγεςϜ • APIαʔόʔ • Rails • ΫϥΠΞϯτ •
React • Elm • Next.js
Studyplus for Schoolͷ։ൃମ੍ • εΫϥϜ։ൃ • 9໊ମ੍ • 2week /
sprint • ։ൃϝϯόʔ • 6໊
Studyplus for Schoolͷ։ൃϑϩʔ ͜͜ΛظؒͰਐΊΔ
چ࣮ϑϩʔ ͜͜ͷͪ࣌ؒΛ࠷খԽ͢Δ ͜͜ͷखΓΛݮΒ͢
ݱߦͷ࣮ϑϩʔ API։ൃஈ֊ͰFBΛ ड͚Δ͜ͱ͕Ͱ͖ɼ खΓ͕গͳ͘ࡁΉ APIͷຊ࣮Λ ͨͣϑϩϯτ։ൃΛ ։࢝Ͱ͖Δ
͍ͬͯΔπʔϧ OpenAPI 3.0 REST APIΛఆٛ͢ΔͨΊඪ४༷ Swagger UI APIεΩʔϚͷ֬ೝ
Gems • committee ϦΫΤετɼϨεϙϯεόϦσʔγϣϯɼςετΞαʔγϣϯ • json_refs ෳϑΝΠϧཧ࣌ͷrefͷղܾ
Copyright (C) 2017 Studyplus, Inc. All Rights Reserved. Confidential APIઃܭ
APIεΩʔϚఆٛ • OpenAPIͷ༷ʹԊͬͯهड़ • yaml • ίϯτϩʔϥͷΞΫγϣϯʹ ରͯ͠1ϑΝΠϧͣͭʹׂ • ύϥϝʔλΤϥʔϨεϙϯ
εͳͲ࠶ར༻ՄೳͳΑ͏ʹ ڞ௨Խ
APIεΩʔϚఆٛϑΝΠϧཧ • main.yaml ΞϓϦέʔγϣϯͷఆٛʢೝূͳͲ • paths.yamlɼpath/* ΤϯυϙΠϯτͷఆٛ •
schemas.yaml, schemas/* ϦιʔεͷఆٛʢϞσϧͱରԠ • parameters.yaml, parameters/* ڞ௨ύϥϝʔλͷఆٛ • responses.yaml, responses/* ڞ௨Ϩεϙϯεͷఆٛ > tree -L 3 swagger/api/v1 ├── components │ ├── schemas.yaml │ ├── parameters.yaml │ ├── responses.yaml │ ├── parameters │ │ ├── section_id.yaml │ │ └── student_id.yaml │ ├── schemas │ │ ├── section.yaml │ │ └── student.yaml ├── paths │ └── sections │ └── index.yaml ├── paths.yaml └── main.yaml
APIεΩʔϚఆٛϑΝΠϧཧ
APIεΩʔϚఆٛϑΝΠϧཧ • main.yaml ΞϓϦέʔγϣϯͷఆٛʢೝূͳͲ • paths.yamlɼpath/* ΤϯυϙΠϯτͷఆٛ •
schemas.yaml, schemas/* ϦιʔεͷఆٛʢϞσϧͱରԠ • parameters.yaml, parameters/* ڞ௨ύϥϝʔλͷఆٛ • responses.yaml, responses/* ڞ௨Ϩεϙϯεͷఆٛ > tree -L 3 swagger/api/v1 ├── components │ ├── schemas.yaml │ ├── parameters.yaml │ ├── responses.yaml │ ├── parameters │ │ ├── section_id.yaml │ │ └── student_id.yaml │ ├── schemas │ │ ├── section.yaml │ │ └── student.yaml ├── paths │ └── sections │ └── index.yaml ├── paths.yaml └── main.yaml
APIεΩʔϚఆٛϑΝΠϧཧ • JSONͰεΩʔϚΛฦ͢APIΛ࣮ • swagger-uiͰ͜ΕΛӾཡ͢Δ
Copyright (C) 2017 Studyplus, Inc. All Rights Reserved. Confidential ϞοΫAPIͷ࡞
ϞοΫAPIͷ࡞ • ͱΓ͋͑ͣಈ͘࠷খݶͷ࣮ 1.routeΛՃ 2.࠷ݶͷςετΛՃ 3.swagger-uiͷϨεϙϯεΛ ίϯτϩʔϥʹϕλషΓ͢Δ 4.ίʔυϨϏϡʔ
εΩʔϚʹաෆແ͍͔֬ೝʂ 5.mergeͯ͠σϓϩΠ
εΩʔϚόϦσʔγϣϯ • ࣮ͱεΩʔϚͷဃࢭ - request specͰอূ - ͯ͢ͷϨεϙϯε͕ఆٛͱဃ͠ ͍ͯͳ͍͔assert_schema_conform Ͱ֬ೝ
- ෳͷAPIʢ෦ެ։ɼ֎෦ެ։ʣ ͕͋ΔͷͰRSpecͷmetadataʹ OpenAPIఆٛϑΝΠϧύεΛࢦఆͰ ͖ΔΑ͏ʹ͍ͯ͠Δ
͜ͷ࣮ϑϩʔͰྑ͔ͬͨ͜ͱ • ϑϩϯτΤϯυ࡞ۀऀͷͪ࣌ؒΛݮͰ͖ͨ • ϞοΫAPIͷ࡞࡞ۀ1~2࣌ؒͰ݁Ͱ͖Δ • API࣮ͷखΓΛ࠷খԽͰ͖Δ • ຊ൪ڥద༻ޙʹमਖ਼͕ඞཁʹͳΔ͜ͱ͕ݮΒͤΔ •
։ൃॳظஈ֊͔Βαʔόʔͱϑϩϯτͷ࡞ۀऀͷೝࣝͷဃ͕ݮͬͨ • ϑϩϯτ࡞ۀऀͱαʔόʔ࡞ۀऀͰεΩʔϚϕʔεͰରͰ͖Δ
ݱঢ়ͷ՝ • enumͳͲͷʹରͯͯ͢͠ͷύλʔϯΛཏͨ͠ϞοΫAPIΛఏڙ͠ Α͏ͱ͢Δͱ໘ →ݱঢ়ϑϩϯτଆʹՃͰϕλॻ͖ͨ͠Γͯ͠ରԠ͍ͯ͠Δ • εΩʔϚࣗମͷόϦσʔγϣϯΛ͍ͯ͠ͳ͍ͷͰtypoͱ͔Λݟಀ͢ͱख Γ͕ൃੜ͢Δ
→validatorͷdocker image͕͋ΔͷͰCIͰνΣοΫ͢ΔΑ͏ʹ͍ͨ͠
࠷ޙʹએ We are hiring!!!
We’re Hiring! ΤϯδχΞืूத https://info.studyplus.co.jp/recruit
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠