SlideShare a Scribd company logo
Fastest to Mobile!
With Scalatra + Swagger!
!
@fehguy!
Swagger Philosophy!
Swagger Philosophy!
Service documentation sucks!
!
typically(
Swagger Philosophy!
•  Communicating is too much work!
– Users don’t want to write YOUR SDK!
– If you’re good at Ruby, you suck at GO!
•  Consumers need a contract!
– Service logic doesn’t belong in the SDK!
•  Services are plumbing!
– We shouldn’t all be plumbers!
– Business logic is your business!
Swagger Philosophy!
•  Solved by machine-readable, discoverable
API contract!
•  Should speed up, not slow down
development process!
•  External services/proxies not required!
What is Swagger?!
•  An interface to your service!
– Described in JSON!
•  It is a contract to your service!
•  Enables “bigotry-free” restful design with
emphasis on getting things done!
– Many ways to delete a Pet!
How does it work?!
•  Discoverable at runtime, not compile-time!
•  It’s just JSON!
•  No server integration required!
– You can describe an API that’s not even yours!
– Deploy anywhere! Put it on github!!
– Swagger is JUST a way to describe an API!
But Why?!
•  Machine-readable contract!
–  Description of *everything* the server
can do!
–  Server-controlled documentation!
–  Server/language/platform/deployment
agnostic!
•  Documentation, code generation,
client generation!
–  Like Headers for C, Interfaces for Java!
How do you add Swagger?!
•  Static Files!
– Manually crafted JSON!
•  Heuristics!
– Traffic inspection!
•  Code inspection!
– Code comments, static annotations!
•  Runtime generation!
It’s just JSON!!
Swagger + Scalatra!
•  Scalatra is a Lightweight, High-
performance Micro web framework!
•  Extremely clean DSL!
•  First-class swagger support!
•  http://www.scalatra.org!
Scalatra as a REST API!
Scalatra as a REST API!
Content&Type&
Nego,a,on&via&
json4s&
Scalatra as a REST API!
Content&Type&
Nego,a,on&via&
json4s&
Simple&Rou,ng&
Scalatra as a REST API!
Content&Type&
Nego,a,on&via&
json4s&
Simple&Rou,ng&
Param&
Extrac,on&
Scalatra as a REST API!
Swagger + Scalatra!
•  Without Swagger Support!
•  With Swagger Support!
Swagger + Scalatra!
•  Auto-
generation of
swagger JSON!!
Swagger + Scalatra!
•  No ugly Java annotations!!
Swagger + Scalatra!
•  Model descriptions!
Swagger + Scalatra!
•  Model descriptions!
Type&safety&
has&its&
benefits!&
Swagger UI for “free”!
Swagger UI for “free”!
Your&Boss&
can&try&your&
API!&
Going Moble!
•  If you are good at scala, you probably
suck at Objective C!
Swagger + Mustache!
•  Typesafe conversion between swagger to
Objective C!
Swagger + Mustache!
•  Typesafe conversion between swagger to
Objective C!
Templates&
you&can&
Tweak!&
Mustache Templates!
Mustache Templates!
Sharing Libraries with Love!
Other Mobile SDKs!
•  Android + Java!
Other Mobile SDKs!
•  Android + Java!
Other Mobile SDKs!
•  Javascript!
Scalatra + Swagger!
•  Simplest DSL for REST APIs in Scala!
•  Minimal dependencies!
•  Tested at scale!
•  Not “hello world”!
•  Apache 2.0 everything!
https://helloreverb.com/swagger/!
!
Questions?!

More Related Content

PDF
Swagger code motion talk
PPTX
Swagger APIs for Humans and Robots (Gluecon)
PDF
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
PDF
Developing Faster with Swagger
PPTX
Inside Wordnik's Architecture
PDF
Swagger / Quick Start Guide
PDF
Scaling tokopedia-past-present-future
PDF
Donald Ferguson - Old Programmers Can Learn New Tricks
Swagger code motion talk
Swagger APIs for Humans and Robots (Gluecon)
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
Developing Faster with Swagger
Inside Wordnik's Architecture
Swagger / Quick Start Guide
Scaling tokopedia-past-present-future
Donald Ferguson - Old Programmers Can Learn New Tricks

What's hot (20)

PDF
How to generate a REST CXF3 application from Swagger ApacheConEU 2016
PDF
OpenAPI Specification概要
PDF
Documenting your REST API with Swagger - JOIN 2014
PDF
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
PDF
Swagger UI
PPTX
AWS for the Java Developer
PDF
Azure Functions - the evolution of microservices platform or marketing gibber...
PDF
SGCE 2015 REST APIs
PDF
Skinny Framework 1.0.0
PDF
Design Driven API Development
PPTX
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
PPTX
EXPERTALKS: Jul 2012 - Build using Gradle
PPTX
GraphQL-ify your APIs
PDF
API Design in the Modern Era - Architecture Next 2020
PDF
eigr.io – a Serverless Runtime on the BEAM (ACM SIGPLAN, ICFP 2021 Erlang Wor...
PPTX
Introduction to Grails 2013
PPTX
Eduards Sizovs - Micro Service Architecture
PDF
WordCamp IL 2016 - WordPress Scale on AWS
PPTX
Vs java (1)
How to generate a REST CXF3 application from Swagger ApacheConEU 2016
OpenAPI Specification概要
Documenting your REST API with Swagger - JOIN 2014
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
Swagger UI
AWS for the Java Developer
Azure Functions - the evolution of microservices platform or marketing gibber...
SGCE 2015 REST APIs
Skinny Framework 1.0.0
Design Driven API Development
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
EXPERTALKS: Jul 2012 - Build using Gradle
GraphQL-ify your APIs
API Design in the Modern Era - Architecture Next 2020
eigr.io – a Serverless Runtime on the BEAM (ACM SIGPLAN, ICFP 2021 Erlang Wor...
Introduction to Grails 2013
Eduards Sizovs - Micro Service Architecture
WordCamp IL 2016 - WordPress Scale on AWS
Vs java (1)
Ad

Similar to Fastest to Mobile with Scalatra + Swagger (20)

PPTX
Swagger - make your API accessible
PPTX
Swagger - Making REST APIs friendlier
PDF
Swagger - Make your REST APIs accessible - Victor Trakhtenberg
PPTX
Contract driven development
PPTX
Scaling with swagger
ODP
Swagger demo
ODP
Introduction to Swagger
PPTX
API Design first with Swagger
PDF
Jcon 2017 How to use Swagger to develop REST applications
PDF
Swagger 2.0: Latest and Greatest
PPTX
Love your API with Swagger (Gluecon lightning talk)
PPT
A Tour of Swagger for APIs
PPTX
Building REST APIs with Django
PPTX
Swagger for startups
PDF
Swagger for-your-api
PPTX
Scala & Swagger at Wordnik
PPTX
Grails with swagger
PPTX
Consuming Restful APIs using Swagger v2.0
PPTX
Rest API with Swagger and NodeJS
PPTX
How to generate a rest application - DevFest Vienna 2016
Swagger - make your API accessible
Swagger - Making REST APIs friendlier
Swagger - Make your REST APIs accessible - Victor Trakhtenberg
Contract driven development
Scaling with swagger
Swagger demo
Introduction to Swagger
API Design first with Swagger
Jcon 2017 How to use Swagger to develop REST applications
Swagger 2.0: Latest and Greatest
Love your API with Swagger (Gluecon lightning talk)
A Tour of Swagger for APIs
Building REST APIs with Django
Swagger for startups
Swagger for-your-api
Scala & Swagger at Wordnik
Grails with swagger
Consuming Restful APIs using Swagger v2.0
Rest API with Swagger and NodeJS
How to generate a rest application - DevFest Vienna 2016
Ad

More from Tony Tam (12)

PPTX
A Tasty deep-dive into Open API Specification Links
PPTX
Writer APIs in Java faster with Swagger Inflector
PPTX
Data Modeling for NoSQL
PPTX
System insight without Interference
PPTX
Keeping MongoDB Data Safe
PPTX
Running MongoDB in the Cloud
PPTX
Introducing Swagger
PPTX
Why Wordnik went non-relational
PPTX
Building a Directed Graph with MongoDB
PPTX
Managing a MongoDB Deployment
PPTX
Keeping the Lights On with MongoDB
PPTX
Migrating from MySQL to MongoDB at Wordnik
A Tasty deep-dive into Open API Specification Links
Writer APIs in Java faster with Swagger Inflector
Data Modeling for NoSQL
System insight without Interference
Keeping MongoDB Data Safe
Running MongoDB in the Cloud
Introducing Swagger
Why Wordnik went non-relational
Building a Directed Graph with MongoDB
Managing a MongoDB Deployment
Keeping the Lights On with MongoDB
Migrating from MySQL to MongoDB at Wordnik

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
KodekX | Application Modernization Development
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Review of recent advances in non-invasive hemoglobin estimation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Cloud computing and distributed systems.
NewMind AI Monthly Chronicles - July 2025
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Advanced Soft Computing BINUS July 2025.pdf
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Fastest to Mobile with Scalatra + Swagger