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
130
1
Share
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
More Decks by Alan Cooke
See All by Alan Cooke
Robots, the best testers your will ever ever build
a1cooke
0
52
ROBOTS, THE BEST TESTERS YOU WILL EVER BUILD
a1cooke
0
140
Tales of a rebuild
a1cooke
0
35
Modernizing Objective-C using Swift
a1cooke
0
93
GDG August 2015 - Retrofit + GSON
a1cooke
0
75
Other Decks in Programming
See All in Programming
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2.7k
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
530
inferと仲良くなる10分間
ryokatsuse
1
310
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
110
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
120
ふつうのFeature Flag実践入門
irof
7
3.4k
Claspは野良GASの夢をみるか
takter00
0
150
Oxlintのカスタムルールの現況
syumai
5
930
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.9k
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.4k
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
220
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
290
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
560
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Leo the Paperboy
mayatellez
7
1.8k
Design in an AI World
tapps
1
220
AI: The stuff that nobody shows you
jnunemaker
PRO
7
670
Designing for humans not robots
tammielis
254
26k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
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