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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
74
Other Decks in Programming
See All in Programming
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
Oxlintはいいぞ
yug1224
5
1.3k
MUSUBIXとは
nahisaho
0
140
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
Architectural Extensions
denyspoltorak
0
290
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.4k
Featured
See All Featured
A better future with KSS
kneath
240
18k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
130
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
120
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
420
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
320
Build your cross-platform service in a week with App Engine
jlugia
234
18k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Statistics for Hackers
jakevdp
799
230k
YesSQL, Process and Tooling at Scale
rocio
174
15k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
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