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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
58
ROBOTS, THE BEST TESTERS YOU WILL EVER BUILD
a1cooke
0
140
Tales of a rebuild
a1cooke
0
36
Modernizing Objective-C using Swift
a1cooke
0
94
GDG August 2015 - Retrofit + GSON
a1cooke
0
76
Other Decks in Programming
See All in Programming
symfony/aiとlaravel/boost
77web
0
130
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
260
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
590
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
270
えっ!!コードを読まずに開発を!?
hananouchi
0
220
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
220
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
6.4k
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
9.1k
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
110
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
140
5分で問診!Composer セキュリティ健康診断
codmoninc
0
360
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
330
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
900
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
770
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Docker and Python
trallard
47
4k
BBQ
matthewcrist
89
10k
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