SlideShare a Scribd company logo
API First
with Play and Swagger
Some points mentioned in the
“The Art of Decomposing Monoliths” talk:
*Akka vs Microservices
*proper contract testing
*forward/backward compatibility
*proper JSON marshalling
*DRY
THEN
Java Developer
LATER
Enterprise
Architect
NOW
Scala Consultant
TWITTER
@slavaschmidt
MAIL
slavaschmidt@gmx.de
THEN
Java Developer
LATER
Enterprise
Architect
NOW
Scala Consultant
TWITTER
@ZALANDO
MAIL
slavaschmidt@gmx.de
NOW
Scala Consultant
@ZALANDO
@ZALANDO
@ZALANDO
@ZALANDO
API First with play and swagger
•Autonomy
•Small in size
•Full responsibility
•One or more components
API First with play and swagger
API First with play and swagger
API First with play and swagger
API First with play and swagger
API First with play and swagger
API First with play and swagger
API First with play and swagger
API First with play and swagger
API First with play and swagger
API First with play and swagger
API First with play and swagger
•Autonomy
•Full responsibility
•One system boundary
API First
Document and
peer review API
before writing a
single line of code
Ideally, generate either
your server interfaces
or your test data (or
both) from the spec
API First with play and swagger
Specification
Server Implementation
Review
Client Implementation
MisinterpretationMisrepresentation
DRY
Dave Thomas
Most people take DRY to mean you shouldn't duplicate code.
That's not its intention. The idea behind DRY is far grander
than that. DRY says that every piece of system knowledge
should have one authoritative, unambiguous representation.
Specification is software
It should be a single source of
truth about the system
Specification
Specification
Specification
Specification
Architectural style
Specification
Architectural style
Technological stack
Architectural style
Architectural style
REST
REST
• Client-Server
• Stateless
• Cacheable
• Layered System
• Uniform Interface
• Identification of resources
• Manipulation of resources through these representations
• Self-descriptive messages
• Hypermedia as the engine of application state
REST
• Self-descriptive messages
• Hypermedia as the engine of application state
REST APIs must be
hypertext-driven
• “A REST API should spend almost all of its descriptive effort in defining the
media type(s) used for representing resources and driving application state,
or in defining extended relation names and/or hypertext-enabled mark-up for
existing standard media types.”
Roy T. Fielding
+ API First
REST
???
ClientServer
Resource representation
Resource representation
Hypermedia controls
Resource representation
Client generation
Documentation annotations
Architecture
aka Ports and Adapters
Chris Fidao
https://www.youtube.com/watch?v=6SBjKOwVq0o
Hexagonal Architecture
Hexagonal Architecture
Hexagonal Architecture
API First with play and swagger
Transport
Transport
Validations
Validations
Model
Model
API First with play and swagger
Getting real…
• Easy to use
• Human readable
• Widest adoption
• Open Source
• Scala and Java
• Dynamic recompilation / Hot reload
• Asynchronous IO
• Easy to use
• URI path definitions (supports parameterisation and templating)
• URI parameter definitions
• Response definitions
• Scheme definitions
• MIME type definitions
• Primitive datatypes
• Complex datatypes
• Structural constraints
• Value constraints
• Security constraints
• Tags
• Vendor extensions
API First with play and swagger
Specification
URLs
Verbs
Parameters
Security
Definitions
Specification
URLs
Verbs
Parameters
Security
Definitions Validations
Model
Test Data
Validations
Play Routes
Marshallers
Tests
Controllers
Security
[A] constructive approach to the problem of program
correctness [is] a usual technique to make a program and
then to test it. But, program testing can be a very effective
way to show the presence of bugs, it is hopelessly
inadequate for showing their absence. The only effective
way to raise the confidence level of a program significantly
is to give a convincing proof of its correctness.
-- Edsger, Wybe Di jkstra, ACM Turing Lecture, The Humble Programmer, 1972
Property based testing
Types are specifications of possible values complying to that Type
Types describe the rules that values must comply to
A possibility to generate ranges of data values for given Types
John Hughes, Haskell’s Quick Check
Boolean: True or False
Equality: Equal or Not Equal
Ordering: Greater, Equal or Less
Provable
Numbers
Strings
Pretty much anything not composed from Provables
Falsifiable
Plugin Architecture
AST
Play
Akka HTTP
Swagger
RAML
Apiary
Blueprint
Lagom
…
…
DEMO
http://github.com/zalando/play-swagger
Questions?

More Related Content

PDF
Contract first, session types later?
PDF
Microservices with Swagger, Flask and Docker
PPTX
Tools and techniques for APIs
PDF
Qark DefCon 23
PPTX
Getting Started with API Security Testing
PPTX
Mobile Application Security Testing (Static Code Analysis) of Android App
PDF
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
PPT
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
Contract first, session types later?
Microservices with Swagger, Flask and Docker
Tools and techniques for APIs
Qark DefCon 23
Getting Started with API Security Testing
Mobile Application Security Testing (Static Code Analysis) of Android App
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...

What's hot (20)

PDF
apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...
PDF
Checkmarx meetup API Security - API Security in depth - Inon Shkedy
PPTX
apidays LIVE LONDON - Discovering API Version differences with ease by Jaap B...
PPTX
API Security and Management Best Practices
PPTX
Server Side Template Injection by Mandeep Jadon
PDF
apidays LIVE Australia 2020 - Evaluating the usability of security APIs by Dr...
PPTX
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
PDF
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
PPTX
Using & Abusing APIs: An Examination of the API Attack Surface
PDF
Protecting Your APIs Against Attack & Hijack
PDF
APISecurity_OWASP_MitigationGuide
PPTX
Level 3 REST Makes Your API Browsable
PDF
WEBINAR: Positive Security for APIs: What it is and why you need it!
PPTX
Abusing Google Apps and Data API: Google is My Command and Control Center
PDF
OpenAPI 3.0, And What It Means for the Future of Swagger
PDF
Are You Properly Using JWTs?
PDF
Securty Testing For RESTful Applications
PDF
OWASP API Security Top 10 - API World
PPTX
Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...
PDF
Robot framework - SAST Väst Q3
apidays LIVE London 2021 - Designing APIs: Less Data is More by Damir Svrtan,...
Checkmarx meetup API Security - API Security in depth - Inon Shkedy
apidays LIVE LONDON - Discovering API Version differences with ease by Jaap B...
API Security and Management Best Practices
Server Side Template Injection by Mandeep Jadon
apidays LIVE Australia 2020 - Evaluating the usability of security APIs by Dr...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
Using & Abusing APIs: An Examination of the API Attack Surface
Protecting Your APIs Against Attack & Hijack
APISecurity_OWASP_MitigationGuide
Level 3 REST Makes Your API Browsable
WEBINAR: Positive Security for APIs: What it is and why you need it!
Abusing Google Apps and Data API: Google is My Command and Control Center
OpenAPI 3.0, And What It Means for the Future of Swagger
Are You Properly Using JWTs?
Securty Testing For RESTful Applications
OWASP API Security Top 10 - API World
Standardizing APIs Across Your Organization with Swagger and OAS | A SmartBea...
Robot framework - SAST Väst Q3
Ad

Viewers also liked (8)

PPTX
Using Apache Camel as AKKA
PDF
Microservices, Monoliths, SOA and How We Got Here
PDF
Slick eventsourcing
PDF
Lightbend Fast Data Platform
PDF
Lightbend Lagom: Microservices Just Right
PDF
Journey to the Modern App with Containers, Microservices and Big Data
PDF
Why The Free Monad isn't Free
PDF
Scala Warrior and type-safe front-end development with Scala.js
Using Apache Camel as AKKA
Microservices, Monoliths, SOA and How We Got Here
Slick eventsourcing
Lightbend Fast Data Platform
Lightbend Lagom: Microservices Just Right
Journey to the Modern App with Containers, Microservices and Big Data
Why The Free Monad isn't Free
Scala Warrior and type-safe front-end development with Scala.js
Ad

Similar to API First with play and swagger (20)

PDF
"Design First" APIs with Swagger
PPTX
Scaling with swagger
PDF
JavaScript for Enterprise Applications
PDF
Swagger for-your-api
PPTX
Design-first API Development using Swagger and Node
PPTX
Contract driven development
PPTX
Building APIs with Node.js and Swagger
PPTX
Scala & Swagger at Wordnik
PDF
Explicit architecture
ODP
Introduction to Swagger
PPTX
Rest API with Swagger and NodeJS
PDF
Enforcing API Design Rules for High Quality Code Generation
PDF
I Love APIs Europe 2015: Developer Sessions
PDF
Microservices - opportunities, dilemmas and problems
PDF
Hexagonal Architecture.pdf
PPTX
Service virtualization with npm modules updated
PPTX
Bojan Veljanovski - Modular Software Architecture and Design (Code Camp 2016)
PPTX
API workshop: Introduction to APIs (TC Camp)
PPTX
Fundamentals Of Software Architecture
PPTX
API Design first with Swagger
"Design First" APIs with Swagger
Scaling with swagger
JavaScript for Enterprise Applications
Swagger for-your-api
Design-first API Development using Swagger and Node
Contract driven development
Building APIs with Node.js and Swagger
Scala & Swagger at Wordnik
Explicit architecture
Introduction to Swagger
Rest API with Swagger and NodeJS
Enforcing API Design Rules for High Quality Code Generation
I Love APIs Europe 2015: Developer Sessions
Microservices - opportunities, dilemmas and problems
Hexagonal Architecture.pdf
Service virtualization with npm modules updated
Bojan Veljanovski - Modular Software Architecture and Design (Code Camp 2016)
API workshop: Introduction to APIs (TC Camp)
Fundamentals Of Software Architecture
API Design first with Swagger

Recently uploaded (20)

PPTX
ai tools demonstartion for schools and inter college
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
System and Network Administraation Chapter 3
PPTX
Essential Infomation Tech presentation.pptx
PPTX
history of c programming in notes for students .pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
top salesforce developer skills in 2025.pdf
PPTX
Introduction to Artificial Intelligence
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
ai tools demonstartion for schools and inter college
Design an Analysis of Algorithms II-SECS-1021-03
PTS Company Brochure 2025 (1).pdf.......
System and Network Administraation Chapter 3
Essential Infomation Tech presentation.pptx
history of c programming in notes for students .pptx
L1 - Introduction to python Backend.pptx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Operating system designcfffgfgggggggvggggggggg
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Wondershare Filmora 15 Crack With Activation Key [2025
Navsoft: AI-Powered Business Solutions & Custom Software Development
How to Choose the Right IT Partner for Your Business in Malaysia
How to Migrate SBCGlobal Email to Yahoo Easily
Design an Analysis of Algorithms I-SECS-1021-03
Softaken Excel to vCard Converter Software.pdf
Digital Strategies for Manufacturing Companies
top salesforce developer skills in 2025.pdf
Introduction to Artificial Intelligence
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

API First with play and swagger