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
Stop writing your API clients by hand
Search
Alan Cooke
August 22, 2018
Programming
1
130
Stop writing your API clients by hand
Introduction and demo of how one can use the Open API Spec to generate API clients on demand.
Alan Cooke
August 22, 2018
Tweet
Share
More Decks by Alan Cooke
See All by Alan Cooke
Robots, the best testers your will ever ever build
a1cooke
0
49
ROBOTS, THE BEST TESTERS YOU WILL EVER BUILD
a1cooke
0
140
Tales of a rebuild
a1cooke
0
33
Modernizing Objective-C using Swift
a1cooke
0
91
GDG August 2015 - Retrofit + GSON
a1cooke
0
73
Other Decks in Programming
See All in Programming
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
660
ゆくKotlin くるRust
exoego
1
160
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
1.9k
GoLab2025 Recap
kuro_kurorrr
0
780
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
150
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
460
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
430
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
410
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
180
Cap'n Webについて
yusukebe
0
150
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
140
Python札幌 LT資料
t3tra
7
1.1k
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
560
The SEO Collaboration Effect
kristinabergwall1
0
310
Docker and Python
trallard
47
3.7k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
29
The Curious Case for Waylosing
cassininazir
0
190
[SF Ruby Conf 2025] Rails X
palkan
0
640
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
61
44k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
A Soul's Torment
seathinner
1
2k
Abbi's Birthday
coloredviolet
0
3.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
710
A Modern Web Designer's Workflow
chriscoyier
698
190k
Transcript
Stop writing your API clients by hand
None
Alan Cooke — Senior Staff Engineer, Mobile
None
None
None
Open API aka Swagger — Open standard — Machine readable
— Language agnostic approach to API specification
None
Path specification paths: /v2/track: post: operationId: Track summary: Track tags:
- Event consumes: - application/json parameters: - name: body in: body schema: $ref: '#/definitions/Event' responses: '200': description: '' security: - X-Outbound-Key: []
Model specification definitions: User: title: User type: object properties: user_id:
type: string first_name: type: string last_name: type: string email: type: string required: - user_id
Security schemes securityDefinitions: X-Outbound-Key: name: X-Outbound-Key type: apiKey in: header
Tooling — Open source tools — Node service you run
locally or hosting service, allows you edit and mock APIs — Commercial tooling — Stoplight.io
Code generators — Open Source repo: https://github.com/swagger-api/ swagger-codegen/ Project broken
into two parts 1. Command Line Interface - swagger-codegen-cli 1. Code generator - swagger-codegen
Writing your own generator 1. Java class, allows you todo
any special pre/post processing of models 2. Collection of mustache template files used to translate model into code
public struct {{classname}}: Codable { {{#allVars}} {{#description}}/** {{description}} */ {{/description}}public
var {{name}}: {{{datatype}}} {{^required}}?{{/required}} {{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} {{/allVars}} }
None
Demo
Questions
None