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
47
ROBOTS, THE BEST TESTERS YOU WILL EVER BUILD
a1cooke
0
140
Tales of a rebuild
a1cooke
0
32
Modernizing Objective-C using Swift
a1cooke
0
89
GDG August 2015 - Retrofit + GSON
a1cooke
0
69
Other Decks in Programming
See All in Programming
オンコール⼊⾨〜ページャーが鳴る前に、あなたが備えられること〜 / Before The Pager Rings
yktakaha4
0
120
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
190
MCPを使ってイベントソーシングのAIコーディングを効率化する / Streamlining Event Sourcing AI Coding with MCP
tomohisa
0
110
Deep Dive into ~/.claude/projects
hiragram
14
2.6k
Startups on Rails in Past, Present and Future–Irina Nazarova, RailsConf 2025
irinanazarova
0
140
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
230
#QiitaBash MCPのセキュリティ
ryosukedtomita
1
1.4k
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
560
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
270
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
130
AI Agent 時代のソフトウェア開発を支える AWS Cloud Development Kit (CDK)
konokenj
3
260
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
5
1.1k
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
140
7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
54k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Being A Developer After 40
akosma
90
590k
KATA
mclloyd
30
14k
Rails Girls Zürich Keynote
gr2m
95
14k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Scaling GitHub
holman
460
140k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
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