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.4k
Introduction to Modern Java
tqjappy
6
8.9k
Writing Nice Code
tqjappy
1
760
Other Decks in Programming
See All in Programming
Ethereum_.pdf
nekomatu
0
470
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.3k
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
240
CSC509 Lecture 13
javiergs
PRO
0
110
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
300
subpath importsで始めるモック生活
10tera
0
320
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
700
みんなでプロポーザルを書いてみた
yuriko1211
0
280
CSC509 Lecture 11
javiergs
PRO
0
180
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
900
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
990
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Agile that works and the tools we love
rasmusluckow
327
21k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Being A Developer After 40
akosma
87
590k
Building Applications with DynamoDB
mza
90
6.1k
Site-Speed That Sticks
csswizardry
0
29
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Building an army of robots
kneath
302
43k
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Ϩεϙϯεͷ ఆٛྻڍ