SlideShare a Scribd company logo
QUICK RECIPE:
HOW TO END MANUAL REST-API
CLIENT CODING
@johannes_fiala
Calling APIs manually
$.getJSON(backend_url ???, data ???, function(response) {
response.???
}
Calling APIs
using a generated SDK
Ingredients
 Swagger API docs
 need to be supplied by the API provider
 can be provided automatically using e.g. Spring Boot +
Swagger-Springfox
 see Swagger.io –Tools & Integrations
 You can also do “API first“ using Swagger-Editor
 Swagger-Codegen
 generate client code in 20+ languages
 Static Javascript support requested in 2013
 … added during dotjs 2015
 … available since 2015-12-07 05:00
Sample REST model using Spring
Boot + Springfox
Swagger API example
Model definition
Steps to generate
Javascript client code
 Prepare
 Checkout Swagger-Codegen
 Generate
 Generate JS client stubs
 Code
 Enjoy code completion for the REST API in
Javascript & HTML
JS Mustache templates for
Swagger-Codegen
Generate client code using
Swagger-Codegen
 java -i http://localhost:8080/v2/api-docs
-l javascript -o c:/myproject
Generated Javascript Model:
Code completion for User
Code completion in HTML
Code completion
for all API operations
Current state of
Javascript support
 API support
 Jsdoc comments + type hints
 Model support
 Jsdoc comments + type hints
 Enumeration support
 Getter/Setter support
 Constructor for required properties
 Print using toJson()
 Plain JS + AMD usage supported
It‘s not yet perfect …
 Support forTypescript
 data types, inheritance, interfaces, enumerations
 More annotations / decorator support
 See Java BeanValidationAPI: @NotNull, @Size,
@Min, @Max, …
 ???
It‘s up to you …
Thank you for your
attention!
 Swagger-Codegen:
 https://github.com/swagger-api/swagger-codegen
(master / scheduled for release 2.1.5)
 Full demo for Spring Boot:
Devoxx 2015 @Youtube
 Questions?
Contact: @johannes_fiala
Resources
 Swagger
http://swagger.io/
 Swagger-Codegen
https://github.com/swagger-api/swagger-codegen
 Spring Boot
http://projects.spring.io/spring-boot/
 Swagger-Springfox
https://github.com/springfox/springfox
 Swagger-UI
https://github.com/swagger-api/swagger-ui
Ad

Recommended

Corley cloud angular in cloud
Corley cloud angular in cloud
Corley S.r.l.
 
Angular js
Angular js
ronhall13
 
Angular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deploy
Corley S.r.l.
 
Angular Seminar-js
Angular Seminar-js
Mindfire Solutions
 
AngularJS: Service, factory & provider
AngularJS: Service, factory & provider
Corley S.r.l.
 
Angular JS Introduction
Angular JS Introduction
Dhyego Fernando
 
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
Restlet
 
Controllers in AngularJs
Controllers in AngularJs
K Arunkumar
 
How to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdf
Katy Slemon
 
Angular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
Scott Lee
 
Consuming Restful APIs using Swagger v2.0
Consuming Restful APIs using Swagger v2.0
Pece Nikolovski
 
Introduction To Angular 4 - J2I
Introduction To Angular 4 - J2I
Nader Debbabi
 
Beyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and more
Ari Lerner
 
Developing a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2I
Nader Debbabi
 
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Emily Hurn
 
What's new in Angular 2?
What's new in Angular 2?
Alfred Jett Grandeza
 
MVC3 Development with visual studio 2010
MVC3 Development with visual studio 2010
AbhishekLuv Kumar
 
Modules in AngularJs
Modules in AngularJs
K Arunkumar
 
Quality sdk for your apis in minutes!
Quality sdk for your apis in minutes!
Son Nguyen
 
Kasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applications
LibbySchulze
 
Angular2 + New Firebase in Action
Angular2 + New Firebase in Action
Ruben Chavarri
 
Why your APIs should fly first class
Why your APIs should fly first class
LibbySchulze
 
WSO2 Product Release Webinar - WSO2 App Factory 2.1
WSO2 Product Release Webinar - WSO2 App Factory 2.1
WSO2
 
Google cloud endpoints
Google cloud endpoints
Dimitar Danailov
 
Angularjs overview
Angularjs overview
VickyCmd
 
Mvc - Titanium
Mvc - Titanium
Prawesh Shrestha
 
Codeigniter
Codeigniter
baabtra.com - No. 1 supplier of quality freshers
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
Tom Johnson
 
Build REST API's using Swagger and IBM Integration Bus IIB v10
Build REST API's using Swagger and IBM Integration Bus IIB v10
Julian Smiles
 

More Related Content

What's hot (20)

How to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdf
Katy Slemon
 
Angular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
Scott Lee
 
Consuming Restful APIs using Swagger v2.0
Consuming Restful APIs using Swagger v2.0
Pece Nikolovski
 
Introduction To Angular 4 - J2I
Introduction To Angular 4 - J2I
Nader Debbabi
 
Beyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and more
Ari Lerner
 
Developing a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2I
Nader Debbabi
 
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Emily Hurn
 
What's new in Angular 2?
What's new in Angular 2?
Alfred Jett Grandeza
 
MVC3 Development with visual studio 2010
MVC3 Development with visual studio 2010
AbhishekLuv Kumar
 
Modules in AngularJs
Modules in AngularJs
K Arunkumar
 
Quality sdk for your apis in minutes!
Quality sdk for your apis in minutes!
Son Nguyen
 
Kasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applications
LibbySchulze
 
Angular2 + New Firebase in Action
Angular2 + New Firebase in Action
Ruben Chavarri
 
Why your APIs should fly first class
Why your APIs should fly first class
LibbySchulze
 
WSO2 Product Release Webinar - WSO2 App Factory 2.1
WSO2 Product Release Webinar - WSO2 App Factory 2.1
WSO2
 
Google cloud endpoints
Google cloud endpoints
Dimitar Danailov
 
Angularjs overview
Angularjs overview
VickyCmd
 
Mvc - Titanium
Mvc - Titanium
Prawesh Shrestha
 
Codeigniter
Codeigniter
baabtra.com - No. 1 supplier of quality freshers
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
How to Integrate Google Adwords API in Laravel App.pdf
How to Integrate Google Adwords API in Laravel App.pdf
Katy Slemon
 
Angular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
Scott Lee
 
Consuming Restful APIs using Swagger v2.0
Consuming Restful APIs using Swagger v2.0
Pece Nikolovski
 
Introduction To Angular 4 - J2I
Introduction To Angular 4 - J2I
Nader Debbabi
 
Beyond AngularJS: Best practices and more
Beyond AngularJS: Best practices and more
Ari Lerner
 
Developing a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2I
Nader Debbabi
 
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Angular2 + Ng-Lightning + Lightning Design System = Great Apps
Emily Hurn
 
MVC3 Development with visual studio 2010
MVC3 Development with visual studio 2010
AbhishekLuv Kumar
 
Modules in AngularJs
Modules in AngularJs
K Arunkumar
 
Quality sdk for your apis in minutes!
Quality sdk for your apis in minutes!
Son Nguyen
 
Kasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applications
LibbySchulze
 
Angular2 + New Firebase in Action
Angular2 + New Firebase in Action
Ruben Chavarri
 
Why your APIs should fly first class
Why your APIs should fly first class
LibbySchulze
 
WSO2 Product Release Webinar - WSO2 App Factory 2.1
WSO2 Product Release Webinar - WSO2 App Factory 2.1
WSO2
 
Angularjs overview
Angularjs overview
VickyCmd
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 

Similar to Rest api code completion for javascript - dotjs 2015 (20)

API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
Tom Johnson
 
Build REST API's using Swagger and IBM Integration Bus IIB v10
Build REST API's using Swagger and IBM Integration Bus IIB v10
Julian Smiles
 
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Gavin Pickin
 
How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016
johannes_fiala
 
Simplify React App Login with Asgardeo React SDK
Simplify React App Login with Asgardeo React SDK
Nipuni Paaris
 
Amazon API Gateway
Amazon API Gateway
Mark Bate
 
How to build a Whatsapp clone in 2 hours
How to build a Whatsapp clone in 2 hours
Jane Chung
 
How to build a Whatsapp clone in 2 hours
How to build a Whatsapp clone in 2 hours
Oursky
 
Amazon API Gateway
Amazon API Gateway
Mark Bate
 
Jcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applications
johannes_fiala
 
RIA / SPA with ASP.NET
RIA / SPA with ASP.NET
Hrvoje Hudoletnjak
 
Walk in the shoe of angular
Walk in the shoe of angular
Fiyaz Hasan
 
Angular App Presentation
Angular App Presentation
Elizabeth Long
 
Developing Apps with Azure AD
Developing Apps with Azure AD
SharePointRadi
 
Build Android App using GCE & GAE
Build Android App using GCE & GAE
Love Sharma
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
Syed Shanu
 
Cloud Endpoints _Polymer_ Material design by Martin Görner
Cloud Endpoints _Polymer_ Material design by Martin Görner
European Innovation Academy
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
jonknapp
 
2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps
Gilles Pommier
 
Adding User Management to Node.js
Adding User Management to Node.js
Dev_Events
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
Tom Johnson
 
Build REST API's using Swagger and IBM Integration Bus IIB v10
Build REST API's using Swagger and IBM Integration Bus IIB v10
Julian Smiles
 
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Gavin Pickin
 
How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016
johannes_fiala
 
Simplify React App Login with Asgardeo React SDK
Simplify React App Login with Asgardeo React SDK
Nipuni Paaris
 
Amazon API Gateway
Amazon API Gateway
Mark Bate
 
How to build a Whatsapp clone in 2 hours
How to build a Whatsapp clone in 2 hours
Jane Chung
 
How to build a Whatsapp clone in 2 hours
How to build a Whatsapp clone in 2 hours
Oursky
 
Amazon API Gateway
Amazon API Gateway
Mark Bate
 
Jcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applications
johannes_fiala
 
Walk in the shoe of angular
Walk in the shoe of angular
Fiyaz Hasan
 
Angular App Presentation
Angular App Presentation
Elizabeth Long
 
Developing Apps with Azure AD
Developing Apps with Azure AD
SharePointRadi
 
Build Android App using GCE & GAE
Build Android App using GCE & GAE
Love Sharma
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
Syed Shanu
 
Cloud Endpoints _Polymer_ Material design by Martin Görner
Cloud Endpoints _Polymer_ Material design by Martin Görner
European Innovation Academy
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
jonknapp
 
2014 SharePoint Saturday Melbourne Apps or not to Apps
2014 SharePoint Saturday Melbourne Apps or not to Apps
Gilles Pommier
 
Adding User Management to Node.js
Adding User Management to Node.js
Dev_Events
 
Ad

Recently uploaded (20)

PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Quantum AI: Where Impossible Becomes Probable
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Quantum AI: Where Impossible Becomes Probable
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
Ad

Rest api code completion for javascript - dotjs 2015