SlideShare a Scribd company logo
Ordina JOIN 2014
Ken Coenen
@CoenenKen
Senior Java Developer
Architecture & Best Practices Competence Lead at Ordina
Documenting your REST API with
SWAGGER
Swagger?
“Swagger is a specification and complete framework
implementation for describing, producing, consuming, and
visualizing RESTful web services.”
Describing
Swagger specification
▪ JSON description of your REST API
▪ APIs
▪ Methods
▪ Models
▪ Conversion from YAML to Swagger available
▪ No need to write this yourself
JSON description of your API
JSON description of a method
JSON description of a model
Producing and consuming
SDK generators
{ Swagger API spec }
Client code Server code
Framework integration
Documentation generation with Jersey
1. Include Maven dependency
(watch out for exclusions!)
Needed for annotation classes
Documentation generation with Jersey (2)
2. Replace regular Jersey servlet with Swagger version
Documentation generation with Jersey (3)
4. API description available on
/api/api-docs
3. Annotate your REST services with
Swagger annotations
Client codegen
1. Written in Scala
2. {{ mustache }} templates
3. Maven goal
4. Generate eg. Java code into a separate Maven module
5. Add Maven dependency to consuming modules
Client codegen pros and cons
▪ All clients have latest code
by executing Codegen
▪ Make sure client code
serializes/deserializes objects
the same as your backend
▪ Session management
▪ Multithreading
▪ Maven integration is hard
Visualizing
Swagger UI API
Swagger UI method
Links
▪ Starting point is http://swagger.io/
▪ GitHub https://github.com/wordnik/swagger-spec
▪ Codegen project https://github.com/wordnik/swagger-codegen
▪ YAML to Swagger https://github.com/wordnik/swagger-
codegen/blob/master/bin/yml2swagger.js
Conclusion
Swagger conclusions
▪ Documentation close to server code
▪ SwaggerUI is major advantage
▪ Don’t expect client codegen to work out-of-the-box
Q&A

More Related Content

What's hot (20)

PPTX
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
PDF
REST API and CRUD
Prem Sanil
 
PDF
Swagger UI
Walaa Hamdy Assy
 
PDF
Swagger With REST APIs.pptx.pdf
Knoldus Inc.
 
PDF
Spring boot introduction
Rasheed Waraich
 
PPTX
Introduction to Spring Boot
Purbarun Chakrabarti
 
PDF
Spring Security
Knoldus Inc.
 
PDF
OpenAPI 3.0, And What It Means for the Future of Swagger
SmartBear
 
PPTX
REST API Design & Development
Ashok Pundit
 
PPTX
Spring boot
Gyanendra Yadav
 
PDF
OWASP API Security Top 10 - API World
42Crunch
 
PPTX
Spring Boot
Jiayun Zhou
 
PPTX
API Testing for everyone.pptx
Pricilla Bilavendran
 
PPT
Spring Core
Pushan Bhattacharya
 
PPTX
Spring boot
Pradeep Shanmugam
 
PPTX
API Security Lifecycle
Apigee | Google Cloud
 
PPT
Angular App Presentation
Elizabeth Long
 
PPTX
Springboot Microservices
NexThoughts Technologies
 
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
REST API and CRUD
Prem Sanil
 
Swagger UI
Walaa Hamdy Assy
 
Swagger With REST APIs.pptx.pdf
Knoldus Inc.
 
Spring boot introduction
Rasheed Waraich
 
Introduction to Spring Boot
Purbarun Chakrabarti
 
Spring Security
Knoldus Inc.
 
OpenAPI 3.0, And What It Means for the Future of Swagger
SmartBear
 
REST API Design & Development
Ashok Pundit
 
Spring boot
Gyanendra Yadav
 
OWASP API Security Top 10 - API World
42Crunch
 
Spring Boot
Jiayun Zhou
 
API Testing for everyone.pptx
Pricilla Bilavendran
 
Spring Core
Pushan Bhattacharya
 
Spring boot
Pradeep Shanmugam
 
API Security Lifecycle
Apigee | Google Cloud
 
Angular App Presentation
Elizabeth Long
 
Springboot Microservices
NexThoughts Technologies
 

Viewers also liked (18)

PDF
Batch Processing - A&BP CC
JWORKS powered by Ordina
 
PDF
Responsive web - CC FE & UX
JWORKS powered by Ordina
 
PDF
mwpc gas gain report
Andrew Schick
 
PPTX
Meteor - JOIN 2015
JWORKS powered by Ordina
 
PPTX
Mongodb @ vrt
JWORKS powered by Ordina
 
PPTX
Clean Code - A&BP CC
JWORKS powered by Ordina
 
PPTX
Big data document and graph d bs - couch-db and orientdb
JWORKS powered by Ordina
 
PDF
Microservices with Netflix OSS & Hypermedia APIs - JavaDay Kiev
JWORKS powered by Ordina
 
PDF
Introduction to Docker
JWORKS powered by Ordina
 
PDF
Spring REST Docs: Documenting RESTful APIs using your tests - Devoxx
JWORKS powered by Ordina
 
PPTX
Mongo db intro.pptx
JWORKS powered by Ordina
 
PDF
Unit testing - A&BP CC
JWORKS powered by Ordina
 
PPTX
Hadoop bootcamp getting started
JWORKS powered by Ordina
 
PDF
An introduction to Cloud Foundry
JWORKS powered by Ordina
 
PPTX
SAP SuccessFactors With BGBS MENA
Darem Alkhayer
 
PDF
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
 
PDF
JavaScript Basics and Best Practices - CC FE & UX
JWORKS powered by Ordina
 
PDF
Lagom in Practice
JWORKS powered by Ordina
 
Batch Processing - A&BP CC
JWORKS powered by Ordina
 
Responsive web - CC FE & UX
JWORKS powered by Ordina
 
mwpc gas gain report
Andrew Schick
 
Meteor - JOIN 2015
JWORKS powered by Ordina
 
Clean Code - A&BP CC
JWORKS powered by Ordina
 
Big data document and graph d bs - couch-db and orientdb
JWORKS powered by Ordina
 
Microservices with Netflix OSS & Hypermedia APIs - JavaDay Kiev
JWORKS powered by Ordina
 
Introduction to Docker
JWORKS powered by Ordina
 
Spring REST Docs: Documenting RESTful APIs using your tests - Devoxx
JWORKS powered by Ordina
 
Mongo db intro.pptx
JWORKS powered by Ordina
 
Unit testing - A&BP CC
JWORKS powered by Ordina
 
Hadoop bootcamp getting started
JWORKS powered by Ordina
 
An introduction to Cloud Foundry
JWORKS powered by Ordina
 
SAP SuccessFactors With BGBS MENA
Darem Alkhayer
 
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
 
JavaScript Basics and Best Practices - CC FE & UX
JWORKS powered by Ordina
 
Lagom in Practice
JWORKS powered by Ordina
 
Ad

Similar to Documenting your REST API with Swagger - JOIN 2014 (20)

PPTX
Swagger - Making REST APIs friendlier
Miroslav Resetar
 
PDF
Swagger 2.0: Latest and Greatest
LaunchAny
 
PPTX
API Design first with Swagger
Tony Tam
 
PPTX
Swagger APIs for Humans and Robots (Gluecon)
Tony Tam
 
PDF
Get Your Node.js API Swaggering with OpenAPI Spec
Adam Paxton
 
PDF
Streamlining API with Swagger.io
Victor Augusteo
 
PPTX
Introducing swagger
Amr Ali
 
PPTX
Grails with swagger
NexThoughts Technologies
 
PDF
Jcon 2017 How to use Swagger to develop REST applications
johannes_fiala
 
PPTX
Everybody loves Swagger
BizTalk360
 
PDF
Swagger - Make your REST APIs accessible - Victor Trakhtenberg
Codemotion Tel Aviv
 
PPTX
Swagger - make your API accessible
Victor Trakhtenberg
 
PDF
Designing APIs with OpenAPI Spec
Adam Paxton
 
PDF
Swagger code motion talk
Victor Trakhtenberg
 
PPTX
dod-api-meetup-03262015-swagger-docs
John O'Brien III
 
PPTX
Consuming Restful APIs using Swagger v2.0
Pece Nikolovski
 
PPTX
How to generate a rest application - DevFest Vienna 2016
johannes_fiala
 
PPTX
Everybody loves Swagger (Massimo Crippa @ Integration Monday)
Codit
 
PDF
Crystal clear service interfaces w/ Swagger/OpenAPI
Scott Triglia
 
PPT
A Tour of Swagger for APIs
Allen Dean
 
Swagger - Making REST APIs friendlier
Miroslav Resetar
 
Swagger 2.0: Latest and Greatest
LaunchAny
 
API Design first with Swagger
Tony Tam
 
Swagger APIs for Humans and Robots (Gluecon)
Tony Tam
 
Get Your Node.js API Swaggering with OpenAPI Spec
Adam Paxton
 
Streamlining API with Swagger.io
Victor Augusteo
 
Introducing swagger
Amr Ali
 
Grails with swagger
NexThoughts Technologies
 
Jcon 2017 How to use Swagger to develop REST applications
johannes_fiala
 
Everybody loves Swagger
BizTalk360
 
Swagger - Make your REST APIs accessible - Victor Trakhtenberg
Codemotion Tel Aviv
 
Swagger - make your API accessible
Victor Trakhtenberg
 
Designing APIs with OpenAPI Spec
Adam Paxton
 
Swagger code motion talk
Victor Trakhtenberg
 
dod-api-meetup-03262015-swagger-docs
John O'Brien III
 
Consuming Restful APIs using Swagger v2.0
Pece Nikolovski
 
How to generate a rest application - DevFest Vienna 2016
johannes_fiala
 
Everybody loves Swagger (Massimo Crippa @ Integration Monday)
Codit
 
Crystal clear service interfaces w/ Swagger/OpenAPI
Scott Triglia
 
A Tour of Swagger for APIs
Allen Dean
 
Ad

More from JWORKS powered by Ordina (17)

PDF
Introduction to Webpack - Ordina JWorks - CC JS & Web
JWORKS powered by Ordina
 
PDF
Netflix OSS and HATEOAS deployed on production - JavaLand
JWORKS powered by Ordina
 
PDF
Cc internet of things @ Thomas More
JWORKS powered by Ordina
 
PDF
Cc internet of things LoRa and IoT - Innovation Enablers
JWORKS powered by Ordina
 
PPTX
Big data key-value and column stores redis - cassandra
JWORKS powered by Ordina
 
PPTX
Big data elasticsearch practical
JWORKS powered by Ordina
 
PDF
Intro to cassandra
JWORKS powered by Ordina
 
PPTX
Android wear - CC Mobile
JWORKS powered by Ordina
 
PDF
Integration testing - A&BP CC
JWORKS powered by Ordina
 
PDF
Spring 4 - A&BP CC
JWORKS powered by Ordina
 
PPTX
Android secure offline storage - CC Mobile
JWORKS powered by Ordina
 
PPTX
Java 7 & 8 - A&BP CC
JWORKS powered by Ordina
 
PDF
IoT: A glance into the future
JWORKS powered by Ordina
 
PDF
Workshop Ionic Framework - CC FE & UX
JWORKS powered by Ordina
 
PDF
IoT: LoRa and Java on the PI
JWORKS powered by Ordina
 
PDF
IoT: An introduction
JWORKS powered by Ordina
 
PDF
Unit Testing in AngularJS - CC FE & UX
JWORKS powered by Ordina
 
Introduction to Webpack - Ordina JWorks - CC JS & Web
JWORKS powered by Ordina
 
Netflix OSS and HATEOAS deployed on production - JavaLand
JWORKS powered by Ordina
 
Cc internet of things @ Thomas More
JWORKS powered by Ordina
 
Cc internet of things LoRa and IoT - Innovation Enablers
JWORKS powered by Ordina
 
Big data key-value and column stores redis - cassandra
JWORKS powered by Ordina
 
Big data elasticsearch practical
JWORKS powered by Ordina
 
Intro to cassandra
JWORKS powered by Ordina
 
Android wear - CC Mobile
JWORKS powered by Ordina
 
Integration testing - A&BP CC
JWORKS powered by Ordina
 
Spring 4 - A&BP CC
JWORKS powered by Ordina
 
Android secure offline storage - CC Mobile
JWORKS powered by Ordina
 
Java 7 & 8 - A&BP CC
JWORKS powered by Ordina
 
IoT: A glance into the future
JWORKS powered by Ordina
 
Workshop Ionic Framework - CC FE & UX
JWORKS powered by Ordina
 
IoT: LoRa and Java on the PI
JWORKS powered by Ordina
 
IoT: An introduction
JWORKS powered by Ordina
 
Unit Testing in AngularJS - CC FE & UX
JWORKS powered by Ordina
 

Recently uploaded (20)

PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Dimensions of Societal Planning in Commonism
StefanMz
 
Horarios de distribución de agua en julio
pegazohn1978
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 

Documenting your REST API with Swagger - JOIN 2014