Visitswaggerhub.comtogetstartedfor free.
Definition Driven API
Development
Feb 22, 2018
Meet Today’s Presenters
Keshav Vasudevan
Product Marketing
Manager
Ryan Pinkham
Marketing Manager
Twitter: @keshinpoint
Page
Visitswaggerhub.comtogetstartedfor free.
3
Twitter: @keshinpoint
Agenda
• The changing APIlandscape
• Overviewof definition drivendevelopment
• Why definition driven APIdevelopment matters?
• Definitions driving design
• Definitions driving documentation
• Definitions driving virtualization
• Definitions driving code
• Definitions driving testing
• Demo
Page
Visitswaggerhub.comtogetstartedfor free.
Understanding Definition Driven
Development
Twitter: @keshinpoint
4
Page
Visitswaggerhub.comtogetstartedfor free.
5
Twitter: @keshinpoint
APIs Have Been Around For A LONG Time
Service Oriented
Architecture
Objectives –
• Services designed with data in mind
• Modelled canonically
• Using data origin (cryptic) vocabulary
• Loose if any documentation
Modern Web APIs
Page
Visitswaggerhub.comtogetstartedfor free.
6
Twitter: @keshinpoint
Trend1:Companies Entering the Platform Ecosystem
Page
Visitswaggerhub.comtogetstartedfor free.
7
Twitter: @keshinpoint
Trend1:Platforms Drive The Internet’s GDP
The internet drives over 1.2 trillion Euros in sales
Platform ecosystems
are a major driver of
this growth
Page
Visitswaggerhub.comtogetstartedfor free.
8
Twitter: @keshinpoint
Trend2:API First Approach
Backend Developers
Frontend Developers
Client A
Database
Implementation Implementation Implementation
Mock Mock Mock
API API API
Client B Client C
The API First approach involves having your APIs as the first and primary element of your
product and service strategy.
Page
Visitswaggerhub.comtogetstartedfor free.
9
Twitter: @keshinpoint
Example Companies Following API First
Model Companies
Page
Visitswaggerhub.comtogetstartedfor free.
Trend3:Explosion in the API Economy
0.3 0.6 0.9
1.5
2.4
3.4
7.2
10.3
12.2
14.1
16.1
0
2
4
6
8
10
12
14
16
18
0 2006 07 08 09 10 11 12 13 14 15 16
85%
ofenterpriseswill
haveanAPIby2018
100,000
PublicAPIs
10
Twitter: @keshinpoint
Page
Visitswaggerhub.comtogetstartedfor free.
11
Twitter: @keshinpoint
The Modern API
• The ModernAPI is no longer datadriven, but consumer driven
• The ModernAPI is staged for self service development and consumption
• The ModernAPI is built for speed of updating and maintenance
• The ModernAPI has a common vocabularly
Reusable interfacesbased on HTTP standards that allow for reuse of data and functions, built for consumer
demand and self-service
Page
Visitswaggerhub.comtogetstartedfor free.
12
Twitter: @keshinpoint
The Definition Driven Answer
Definition DrivenAPIdevelopment advocatesfor designing the API’s contractfirst before any other lifecycle
operation.
Implementation Maintenance Consumption
Drives
Page
Visitswaggerhub.comtogetstartedfor free.
13
Twitter: @keshinpoint
A CommonVocabulary
• AdefinitionisaframeworkfordescribingAPIs
• MachineANDhumanreadable
• Languageagnostic
The OpenAPI Specification (OAS)is the world’s standard
for defining RESTful API
Page
Visitswaggerhub.comtogetstartedfor free.
14
Twitter: @keshinpoint
OAS Opens Up AWorld Of Possibilities
Page
Visitswaggerhub.comtogetstartedfor free.
15
Twitter: @keshinpoint
Advantages Of Definition Driven Development
Reduced interdependencies, allows teamsto workattheir own pace
Faster development and delivery
Easier expansion to different interfaces,clients and views
Developer friendly servicesto build ecosystems and platforms
Faster Development
New Revenue Channels
and Growth
Page
Visitswaggerhub.comtogetstartedfor free.
Definition Driven Lifecycle
Speed
Quality
Cost
Design Virtualize Develop DeployPlan
Innovation
Value
Creation
Software Development Lifecycle
Test
Twitter: @keshinpoint
16
Page
Visitswaggerhub.comtogetstartedfor free.
17
Twitter: @keshinpoint
Definitions Touch Every Phase Of The Lifecycle
Design
Document
Virtualize
Code
Test
Definitions Affect Every Part Of The
API Lifecycle
Twitter: @keshinpoint
1
8
Page
Visitswaggerhub.comtogetstartedfor free.
19
Twitter: @keshinpoint
Definitions Touch Every Phase Of The Lifecycle
Design
Document
Virtualize
Code
Test
Page
Visitswaggerhub.comtogetstartedfor free.
20
Twitter: @keshinpoint
Conceptualizing The Service
Designing with a definition forces you to think about -
Identify organization’s business taxanomy
- Map APItoorganization’s taxanomy
Tangibleoutcometointernalprocesses Tangibleoutcometobusiness Tangibleoutcometocustomer
Page
Visitswaggerhub.comtogetstartedfor free.
21
OpenAPI Design Example
API Info
API Request
API Response
Twitter: @keshinpoint
Page
Visitswaggerhub.comtogetstartedfor free.
Design Keeps Stakeholders Aligned
Restful
Interface
Technical
Writer
Developer Tester
Architect
Keeps in
Sync
22
Twitter: @keshinpoint
Page
Visitswaggerhub.comtogetstartedfor free.
23
Twitter: @keshinpoint
Example Definition Driven Process
Proposal Align Review Design DevelopVerify Deploy
Used by
Page
Visitswaggerhub.comtogetstartedfor free.
24
Twitter: @keshinpoint
Definitions Touch Every Phase Of The Lifecycle
Design
Document
Virtualize
Code
Test
Page
Visitswaggerhub.comtogetstartedfor free.
Documentation
Call the API
(request)
Obtain data
(response)
Restful
Interface
Technical
Writer
Developer Tester
Architect
Keeps in
Sync
25
Twitter: @keshinpoint
Page
Visitswaggerhub.comtogetstartedfor free.
26
Twitter: @keshinpoint
Advantages of Documentation From Definition
Auto generation From contract
Fully interactive
Hosted anywhere
Swagger UI
Page
Visitswaggerhub.comtogetstartedfor free.
Examples of Documentation
27
Twitter: @keshinpoint
Page
Visitswaggerhub.comtogetstartedfor free.
28
Twitter: @keshinpoint
Definitions Touch Every Phase Of The Lifecycle
Design
Document
Virtualize
Code
Test
Page
Visitswaggerhub.comtogetstartedfor free.
What is ServiceVirtualization
Virtualization accuratelymimics/simulates behavior of components thatare unavailable or difficult to access
during software development and beyond.
Examples of Components that canbe Virtualized:
Devices Database API Network
Twitter: @keshinpoint
29
Page
Visitswaggerhub.comtogetstartedfor free.
30
Twitter: @keshinpoint
Virtualization From The Definition
• Developers
• Testers
• Other
stakeholders
Consumer
Virtualization
Development
Page
Visitswaggerhub.comtogetstartedfor free.
31
Twitter: @keshinpoint
Advantages ofVirtualization From The Definition
Reduce dependency betweenteams(backend and front
end; database etc)
Enables paralleldevelopment
Faster prototyping
Service Virtualization
Overcome rate limits & reduce
3rd party risk
Test your service when a
virtualized API misbehaves
Use descriptors, discovery, or
manually design your sandbox
Why ServiceV Pro from SmartBear?
Create virtual services fast, locally and on the
cloud
Virtualize APIs, databases with minimal
configuration
Page
Visitswaggerhub.comtogetstartedfor free.
32
Twitter: @keshinpoint
Definitions Touch Every Phase Of The Lifecycle
Design
Document
Virtualize
Code
Test
Page
Visitswaggerhub.comtogetstartedfor free.
33
Twitter: @keshinpoint
Code-Generation From The Definition
The OAS definition allows you togenerate serverstubs and clientSDKs directlyfrom the definition
Codegeneration
Developer
Consumer
Page
Visitswaggerhub.comtogetstartedfor free.
34
Twitter: @keshinpoint
Advantages of CodeGen
No wasting time on boiler plate code
Out of box SDK generation for easy consumption
Faster prototyping
Swagger Codegen
Page
Visitswaggerhub.comtogetstartedfor free.
35
Twitter: @keshinpoint
Definitions Touch Every Phase Of The Lifecycle
Design
Document
Virtualize
Code
Test
Page
Visitswaggerhub.comtogetstartedfor free.
36
Twitter: @keshinpoint
Testing From The Definition
The OAS definition allows you togenerate test casesdirectly from the contract
ReadyAPI
testing
Tester
Test
Test cases
Refactored
Refactored
Page
Visitswaggerhub.comtogetstartedfor free.
37
Twitter: @keshinpoint
Advantages of Testing From The Definition
Reduce time to marketby generating quick tests
Easily tie backto development process and refactorchanges
Mitigate risk Why ReadyAPI from SmartBear?
Easy to get started with minimum training
and skills
Over 10 Million developers and testers love
the ease of use
Powerful support for REST, SOAP, JMS and
other protocols
ReadyAPI
testing
Page
Visitswaggerhub.comtogetstartedfor free.
38
Twitter: @keshinpoint
Definitions Touch Every Phase Of The Lifecycle
Design
Document
Virtualize
Code
Test
Page
Visitswaggerhub.comtogetstartedfor free.
Getting To The Definition
StandardsdriveefficientengineeringandbetterconsumptionofAPIs
OpenAPISpecDesignFirst CodeFirst
Twitter: @keshinpoint
39
Page
Visitswaggerhub.comtogetstartedfor free.
Swagger Inspector
Swagger Inspector is an easy to use online tool to quickly execute any API request, validate its
responses and generate a corresponding OpenAPI definition.
CloudBasedand
Free
OpenAPIDefinition
GenerationTestandValidate
Core Value: Ensure APIs work as intended, visually explore APIs, and create
user-friendly documentation.
Twitter: @keshinpoint
40
Page
Visitswaggerhub.comtogetstartedfor free.
41
Swagger HasYour Back
Specification
Tools
Demo Scenario
Twitter: @keshinpoint
4
2
Page
Visitswaggerhub.comtogetstartedfor free.
43
What Is SwaggerHub?
Faster,Standardized
Design
SwaggerHub is the API design and documentation
platform built for teams to drive consistency and
discipline across their API development workflow.
Confusion Free Collaboration Centralized API Catalog
Demo Scenario
• Company: Darth Corporation
• Context:
• Dart Co. has been around for 100 years
• They have a mixture of legacy Star Wars APIs and modernized APIs
• Moving forward, they want to leverage a design first approach
• Objectives:
• Generate the definition from an existing legacy API for the deathstar
• Create a new API that retrieves information from employee database
• API Stakeholders:
• Business:
• BusinessDev & BA
• Technical:
• Architects,Developers,Tech Writers, QA, & Operations
Twitter: @keshinpoint
Demo Scenario
LegacyAPI
Definition
DefinitionDrivenApproach
Definition Test
Virtualize
Design
Document
Code
Twitter: @keshinpoint
Visitswaggerhub.comtogetstartedfor free.
Thank you!
Learnmore:
SwaggerHub.com or emailquestions to
info@swaggerhub.com

Definition Driven API Development: How OAS & Swagger Help Teams Streamline Their API Development