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
gopls を改造したら開発生産性が高まった
satorunooshie
8
240
Realtime API 入門
riofujimon
0
110
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
430
CSC509 Lecture 09
javiergs
PRO
0
110
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
Piniaの現状と今後
waka292
5
1.5k
PagerDuty を軸にした On-Call 構築と運用課題の解決 / PagerDuty Japan Community Meetup 4
horimislime
1
110
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
150
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
330
Go言語でターミナルフレンドリーなAIコマンド、afaを作った/fukuokago20_afa
monochromegane
2
140
GCCのプラグインを作る / I Made a GCC Plugin
shouth
1
150
macOS でできる リアルタイム動画像処理
biacco42
7
1.8k
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Code Review Best Practice
trishagee
64
17k
Building Applications with DynamoDB
mza
90
6.1k
It's Worth the Effort
3n
183
27k
Music & Morning Musume
bryan
46
6.1k
Fireside Chat
paigeccino
32
3k
A better future with KSS
kneath
238
17k
Fontdeck: Realign not Redesign
paulrobertlloyd
81
5.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
3
370
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
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Ϩεϙϯεͷ ఆٛྻڍ