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
5分くらいでわかるSwagger / 5minutes-swagger
Search
Takumi Endo
November 09, 2015
Programming
1
1.5k
5分くらいでわかるSwagger / 5minutes-swagger
Takumi Endo
November 09, 2015
Tweet
Share
More Decks by Takumi Endo
See All by Takumi Endo
ヒトとクルマと業務をつなげるコネクテッドカーサービス「Cariot」のAPI/Cariot API
tqjappy
2
3.3k
Introduction to Modern Java
tqjappy
6
8.9k
Writing Nice Code
tqjappy
1
750
Other Decks in Programming
See All in Programming
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.5k
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.5k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
7
430
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
240
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
480
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
170
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
210
macOS でできる リアルタイム動画像処理
biacco42
6
1.7k
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
C#/.NETのこれまでのふりかえり
tomokusaba
1
150
hotwire_or_react
harunatsujita
8
4k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
430
Featured
See All Featured
Designing the Hi-DPI Web
ddemaree
280
34k
How to Ace a Technical Interview
jacobian
275
23k
GraphQLとの向き合い方2022年版
quramy
43
13k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Rails Girls Zürich Keynote
gr2m
93
13k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Making the Leap to Tech Lead
cromwellryan
132
8.9k
Designing Experiences People Love
moore
138
23k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Transcript
Swagger 5͘Β͍ͰΘ͔Δ T. Endo
http://swagger.io/
4XBHHFS w 3&45GVM"1*υΩϡϝϯτ࡞ͷͨΊ ͷϑϨʔϜϫʔΫ w +40/PS:".-Ͱ"1*༷Λॻ͘ ʢ4XBHHFS4QFDJpDBUJPOɺҎԼɺ4XBHHFS4QFDʣ w 0QFO"1**OJUJBUJWFͰ࠾༻
4XBHHFS 4QFD +40/:".- ίʔυ +BWB 1)1ʣ ! 4XBHHFS6* "84"1*(BUFXBZ ֎෦࿈ܞ
4XBHHFS $PEFHFO ಡΈࠐΈ "NB[PO"1* (BUFXBZ*NQPSUFS ΤίγεςϜ 4XBHHFS&EJUPS ʢΦϯϥΠϯΤσΟλʣ
4XBHHFS4QFDΛॻ͘ w 4XBHHFS&EJUPS IUUQFEJUPSTXBHHFSJP ɾΦϯϥΠϯΤσΟλ ʢ͍׳ΕͨΤσΟλͰॻ͍ͯՄʣ ɾ݁ߏϝϞϦΛ͏ ɹ$ISPNF͕ϝϞϦෆͰ ɹམͪΔ͜ͱʜ ϦΞϧλΠϜʹө
ɾهड़ͨ͠༰ίʔυ 4%, ɹ4XBHHFS4QFDͷ ɹΤΫεϙʔτ͕Ͱ͖Δ
4XBHHFS6* ͜ͷϑΥʔϜ͔ zVSMzΫΤϦύϥϝʔλʹ TXBHHFSTQFDͷ63-Λ ॻ͘ ॻ͍ͨ4XBHHFS4QFD͕ ʮ7"-*%ʯͰ͋Δ͜ͱΛ ֬ೝ
ʮ5SZJUPVUʯ "1*Λ࣮ߦͯ͠ ࢼ͢͜ͱ͕Ͱ͖Δ ʢΫϩεΦϦδϯʣ
4XBHHFS4QFDͷ จ๏
4XBHHFS4QFDͷֶͼํ w IUUQTXBHHFSJPTQFDJpDBUJPO w ݱόʔδϣϯ w طଘͷαϯϓϧΛݟ֮ͯ͑Δͷ͕ۙಓ ! w ֶशίετ͍ʢͱࢥ͏ʣ
ʢ"NB[PO"1*(BUFXBZ*NQPSUFSͷ UTUSFTPVSDFTTXBHHFSҎԼͷϑΝΠϧͱ͔͓͢͢Ίʣ
4XBHHFS4QFDͷߏ جຊใ swagger ! info! host! schemes! basePath! tags! produces
"1*ఆٛ Ϟσϧఆٛ paths definitions \ \ \ ˞ඞਢ߲ ʢʣ͜ΕͰશͯͰͳ͍Ͱ͢
جຊใ swagger: '2.0'! info:! title: Sample API! description: Swagger Sample!
host: xxx.sample.jp! schemes:! - https! basePath: /api! tags:! - name: User! description: Ϣʔβ! produces:! - application/json :".-Ͱͷྫ ʢجຊ+40/Ͱಉ͡ʣ IUUQ IUUQT XT XTTͷ ͲΕ͔
Ϟσϧఆٛ ϦΫΤετϨεϙϯεͰ͏σʔλܕΛϞσϧͱͯ͠ఆ͍ٛͯ͘͠ ˞JE OBNF BHFͱ͍͏ ͭͷϑΟʔϧυΛͭ 6TFSϞσϧΛఆٛ͢Δྫ definitions:! User:! type:
object! properties:! id:! type: integer! description: id of user! name:! type: string! description: name of user! age:! type: number! description: age of user Ϟσϧ໊
paths:! /users/{id}:! get:! summary: get user list! description: xxx! parameters:!
- name: id! in: path! required: false! type: integer! tags:! - User! responses:! '200'! description: user list! schema:! $ref: '#/definitions/User' "1*ఆٛ ఆٛͨ͠6TFS ϞσϧΛฦ͢ RVFSZ IFBEFS QBUI CPEZ GPSN%BUBͷ ͲΕ͔ )551ϝιου )551Ϩεϙϯεͷ ఆٛྻڍ