SlideShare a Scribd company logo
REST Coder
Auto Generating Client Stubs and Documentation for RESTful Services
Hiranya Jayathilaka & Stratos Dimopoulos
CS263 - Spring 2013

S
What to Expect

S SOA, Web Services and APIs
S The REST ecosystem – Machine readable API

descriptions for REST
S Introduction to REST Coder – Tools and architecture
S Live Demos
S Challenges and Future Work
Service Oriented Architecture

S An architectural paradigm and a way of thinking about

designing software systems.
S A system is a structured collection of highly reusable

modules known as services.
S Language and platform neutral implementation model.
Services and APIs

S Service
S Meant to be combined with other services to build useful

applications.
S Has a well defined interface (contract).
S API
S The visible interface of a service.
SOAP vs. REST

SOAP

REST

Governed by a collection of W3C
and OASIS standards

A collection of ideas from Roy
Fielding’s Ph.D. dissertation

Standard message formats,
standard APIs, standard everything

Flexible

Heavyweight – Need a lot of code

Lightweight – Just need some
HTTP API support

Slow – Consumes resources

Fast – Conservative

Decaying popularity

Everybody loves REST 
REST in Peace SOAP!
Service/API Ecosystem for
REST
Ecosystem Feature

State-of-the-Art

Service development

Mature

Lifecycle management

Emerging

Subscription management, SLA
enforcement and monitoring

Emerging

Machine readable API descriptions

No widely accepted standards

API documentation

Manual

API discovery

Manual

API consumption

Manual

Automated reasoning

Existing methods too complex for
widespread use
Our Approach

S A simple, structured, machine-readable API description

language.
S A collection of tools for auto-generating and processing

API descriptions.
S Automated API discovery and engagement
S Automated API consumption
S Automated API doc generation
S Automated reasoning about APIs
API Description Language

S Simple, structured language based on JSON
S Captures –
S Functional properties (resources, operations, security

constraints etc.)
S Data models (simple structured type system inspired by
Thrift)
S Non-functional properties (licensing information, SLA details,
ownership details etc.)
REST Coder

S A set of tools for auto generating API docs and client

stubs from a given API description.
S Three main components/tools.
S HTML/JavaScript code generator
S Sphinx API doc generator

S Python client stub generator
HTML/JS Code Generator

S Given an input API description, generates a set of API

docs in HTML format.
S Augments HTML-based API docs with JS/JQuery code to

invoke the remote API on-line.
System Architecture

JSON
Description

Code Generator
(Java/Velocity)

API Documentation/
Client
(HTML/JQuery)

Reverse Proxy
(NodeJS /
Express)

REST API
(Tomcat)
Sphinx API Doc Generator

S Given an input API description, generates a collection of

reStructred text (.rst) files and compiles them using
Sphinx.
S Generates an index page and a separate page for each

resource and user-defined data type in the API
description.
S Automatically creates links between pages to provide

easy navigation between related topics.
Python Client Stub Generator

S Given an input API description, generates a Python (2.7)

module that can be used as a client stub (proxy) to
consume the API.
S Useful in developing desktop apps, command-line tools,

webapps and mashups in Python.
S Generates a separate Python class for each resource in

the API description.
S Convert API docs into Python docstrings.
Challenges

S

Recursive type system is easy to understand but complex to generate
code for.

S

Required vs. optional parameters.

S

Avoiding the generation of boilerplate code – Reusing generated code.

S

Handling different media types.

S

Managing symbols and identifiers during the code generation.

S

Handling incomplete API descriptions.

S

Cross-site API calls in JavaScript (Same origin policy)
Future Work

S Auto generating code for secured (OAuth, BasicAuth)

APIs.
S Auto generating test cases.
S Generating code that validates/enforces documented API

pre-conditions and post-conditions (contracts).
S Support for more media types.
S Auto generating entire apps/mashups.
Questions?
References

S

M. Maleshkova, C. Pedrinaci, and J. Domingue, “Investigating Web APIs on the
World Wide Web”, European Conference on Web Services (ECOWS)

S

D. Bianchini, V. De Antonellis, and M. Melchiori, “Semantics-enabled web APIs
selection pattern”, In Proceedings of the 15th Symposium on International Database
Engineering & Applications (IDEAS '11)

S

Jacek Kopecký, Karthik Gomadam, and Tomas Vitvar. 2008, “hRESTS: An HTML
Microformat for Describing RESTful Web Services” In Proceedings of the 2008
IEEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent
Technology

S

WADL - http://www.w3.org/Submission/wadl/

S

Swagger - https://developers.helloreverb.com/swagger/

More Related Content

What's hot (19)

PDF
Liferay as a headless platform
Jorge Ferrer
 
PDF
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
Jorge Ferrer
 
PPTX
What is Swagger?
Philip Senger
 
PPT
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
apidays
 
PPTX
Building APIs with Node.js and Swagger
Jeremy Whitlock
 
PPTX
StrongLoop Overview
Shubhra Kar
 
PDF
Implement Web API with Swagger
Jiang Wu
 
PDF
Ibm_interconnect_restapi_workshop
Shubhra Kar
 
PDF
OpenAPI development with Python
Takuro Wada
 
PDF
apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...
apidays
 
PPTX
APIs and Linked Data: A match made in Heaven
Michael Petychakis
 
PPTX
Rest API with Swagger and NodeJS
Luigi Saetta
 
PDF
Swagger for-your-api
Tony Tam
 
PPTX
Swagger APIs for Humans and Robots (Gluecon)
Tony Tam
 
PPTX
Publishing strategies for API documentation
Tom Johnson
 
PPT
APIs And SDKs Breaking Into And Succeeding In A Specialty Market
Bill Dubie
 
PPTX
Introducing Swagger
Tony Tam
 
PDF
API Description Languages
Akana
 
PDF
Designing APIs with OpenAPI Spec
Adam Paxton
 
Liferay as a headless platform
Jorge Ferrer
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
Jorge Ferrer
 
What is Swagger?
Philip Senger
 
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
apidays
 
Building APIs with Node.js and Swagger
Jeremy Whitlock
 
StrongLoop Overview
Shubhra Kar
 
Implement Web API with Swagger
Jiang Wu
 
Ibm_interconnect_restapi_workshop
Shubhra Kar
 
OpenAPI development with Python
Takuro Wada
 
apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...
apidays
 
APIs and Linked Data: A match made in Heaven
Michael Petychakis
 
Rest API with Swagger and NodeJS
Luigi Saetta
 
Swagger for-your-api
Tony Tam
 
Swagger APIs for Humans and Robots (Gluecon)
Tony Tam
 
Publishing strategies for API documentation
Tom Johnson
 
APIs And SDKs Breaking Into And Succeeding In A Specialty Market
Bill Dubie
 
Introducing Swagger
Tony Tam
 
API Description Languages
Akana
 
Designing APIs with OpenAPI Spec
Adam Paxton
 

Viewers also liked (20)

PDF
Atlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
Matt Ray
 
PDF
Open-E DSS V7 Active-Active Load Balanced iSCSI HA Cluster (with bonding)
open-e
 
PDF
Pycon 2008: Python Command-line Tools *Nix
Lecturer UC Davis & Northwestern
 
PPTX
Red Hat Storage Day Seattle: Why Software-Defined Storage Matters
Red_Hat_Storage
 
PDF
Modern Web App Development using ClojureScript & React.js / Baishampayan “BG”...
Ontico
 
PDF
OpenStack Deployment with Chef Workshop
Matt Ray
 
PPTX
Event Driven Architecture - MeshU - Ilya Grigorik
Ilya Grigorik
 
PDF
Introduction to Apache Synapse
Hiranya Jayathilaka
 
PDF
Best Practice for Deploying Application with Heat
Ethan Lynn
 
PPT
Swift Architecture and Practice, by Alex Yang
Hui Cheng
 
PDF
TXLF: Automated Deployment of OpenStack with Chef
Matt Ray
 
PDF
React.jsでHowManyPizza
松田 千尋
 
PDF
Are We Done Yet ? Testing Your OpenStack Deployment
Ken Pepple
 
PDF
Building RESTful APIs
Silota Inc.
 
PPTX
Software Defined presentation
John Rhodes
 
PPTX
Mirantis open stack deployment automation
WooKyun Jeon
 
PDF
Microservices with Swagger, Flask and Docker
Dhilipsiva DS
 
PPTX
Core Concept: Software Defined Everything
Thanakrit Lersmethasakul
 
PPTX
"FCoE vs. iSCSI - Making the Choice" from Interop Las Vegas 2011
Stephen Foskett
 
PDF
Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis
 
Atlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
Matt Ray
 
Open-E DSS V7 Active-Active Load Balanced iSCSI HA Cluster (with bonding)
open-e
 
Pycon 2008: Python Command-line Tools *Nix
Lecturer UC Davis & Northwestern
 
Red Hat Storage Day Seattle: Why Software-Defined Storage Matters
Red_Hat_Storage
 
Modern Web App Development using ClojureScript & React.js / Baishampayan “BG”...
Ontico
 
OpenStack Deployment with Chef Workshop
Matt Ray
 
Event Driven Architecture - MeshU - Ilya Grigorik
Ilya Grigorik
 
Introduction to Apache Synapse
Hiranya Jayathilaka
 
Best Practice for Deploying Application with Heat
Ethan Lynn
 
Swift Architecture and Practice, by Alex Yang
Hui Cheng
 
TXLF: Automated Deployment of OpenStack with Chef
Matt Ray
 
React.jsでHowManyPizza
松田 千尋
 
Are We Done Yet ? Testing Your OpenStack Deployment
Ken Pepple
 
Building RESTful APIs
Silota Inc.
 
Software Defined presentation
John Rhodes
 
Mirantis open stack deployment automation
WooKyun Jeon
 
Microservices with Swagger, Flask and Docker
Dhilipsiva DS
 
Core Concept: Software Defined Everything
Thanakrit Lersmethasakul
 
"FCoE vs. iSCSI - Making the Choice" from Interop Las Vegas 2011
Stephen Foskett
 
Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis
 
Ad

Similar to REST Coder: Auto Generating Client Stubs and Documentation for REST APIs (20)

PPTX
Scaling with swagger
Tony Tam
 
PDF
Ebook undisturbed rest-v1 [res_tful apis]
johnkbutcher
 
PDF
Swagger: Restful documentation that won't put you to sleep
Tobias Coetzee
 
PPTX
API Description Languages: Which is the Right One for Me?
Akana
 
PPTX
Nom Nom: Consuming REST APIs
Tessa Mero
 
PDF
Past, Present and Future of APIs of Mobile and Web Apps
SmartBear
 
PPTX
OpenAPI v.Next - Events, Alternative Schemas & the Road Ahead
Ted Epstein
 
PPTX
Nom Nom: Consuming REST APIs
Tessa Mero
 
PDF
API Description Languages
Akana
 
PDF
Introduction to REST - REST Basics - JSON
Matrix823409
 
PPTX
API workshop: Introduction to APIs (TC Camp)
Tom Johnson
 
PDF
REST full API Design
Christian Guenther
 
PDF
Cloud Native API Design and Management
AllBits BVBA (freelancer)
 
PPTX
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
PPTX
APIdays Paris 2014 - The State of Web API Languages
Restlet
 
PDF
Web APIs: The future of software
Reuven Lerner
 
PPTX
Apitesting.pptx
NamanVerma88
 
PPTX
API Athens Meetup - API standards 25-6-2014
openi_ict
 
PDF
Restful风格ž„web服务架构
Benjamin Tan
 
Scaling with swagger
Tony Tam
 
Ebook undisturbed rest-v1 [res_tful apis]
johnkbutcher
 
Swagger: Restful documentation that won't put you to sleep
Tobias Coetzee
 
API Description Languages: Which is the Right One for Me?
Akana
 
Nom Nom: Consuming REST APIs
Tessa Mero
 
Past, Present and Future of APIs of Mobile and Web Apps
SmartBear
 
OpenAPI v.Next - Events, Alternative Schemas & the Road Ahead
Ted Epstein
 
Nom Nom: Consuming REST APIs
Tessa Mero
 
API Description Languages
Akana
 
Introduction to REST - REST Basics - JSON
Matrix823409
 
API workshop: Introduction to APIs (TC Camp)
Tom Johnson
 
REST full API Design
Christian Guenther
 
Cloud Native API Design and Management
AllBits BVBA (freelancer)
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Jackson F. de A. Mafra
 
APIdays Paris 2014 - The State of Web API Languages
Restlet
 
Web APIs: The future of software
Reuven Lerner
 
Apitesting.pptx
NamanVerma88
 
API Athens Meetup - API standards 25-6-2014
openi_ict
 
Restful风格ž„web服务架构
Benjamin Tan
 
Ad

Recently uploaded (20)

PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Open Source Milvus Vector Database v 2.6
Zilliz
 
PPTX
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PDF
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Open Source Milvus Vector Database v 2.6
Zilliz
 
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
The Growing Value and Application of FME & GenAI
Safe Software
 
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 

REST Coder: Auto Generating Client Stubs and Documentation for REST APIs

  • 1. REST Coder Auto Generating Client Stubs and Documentation for RESTful Services Hiranya Jayathilaka & Stratos Dimopoulos CS263 - Spring 2013 S
  • 2. What to Expect S SOA, Web Services and APIs S The REST ecosystem – Machine readable API descriptions for REST S Introduction to REST Coder – Tools and architecture S Live Demos S Challenges and Future Work
  • 3. Service Oriented Architecture S An architectural paradigm and a way of thinking about designing software systems. S A system is a structured collection of highly reusable modules known as services. S Language and platform neutral implementation model.
  • 4. Services and APIs S Service S Meant to be combined with other services to build useful applications. S Has a well defined interface (contract). S API S The visible interface of a service.
  • 5. SOAP vs. REST SOAP REST Governed by a collection of W3C and OASIS standards A collection of ideas from Roy Fielding’s Ph.D. dissertation Standard message formats, standard APIs, standard everything Flexible Heavyweight – Need a lot of code Lightweight – Just need some HTTP API support Slow – Consumes resources Fast – Conservative Decaying popularity Everybody loves REST 
  • 7. Service/API Ecosystem for REST Ecosystem Feature State-of-the-Art Service development Mature Lifecycle management Emerging Subscription management, SLA enforcement and monitoring Emerging Machine readable API descriptions No widely accepted standards API documentation Manual API discovery Manual API consumption Manual Automated reasoning Existing methods too complex for widespread use
  • 8. Our Approach S A simple, structured, machine-readable API description language. S A collection of tools for auto-generating and processing API descriptions. S Automated API discovery and engagement S Automated API consumption S Automated API doc generation S Automated reasoning about APIs
  • 9. API Description Language S Simple, structured language based on JSON S Captures – S Functional properties (resources, operations, security constraints etc.) S Data models (simple structured type system inspired by Thrift) S Non-functional properties (licensing information, SLA details, ownership details etc.)
  • 10. REST Coder S A set of tools for auto generating API docs and client stubs from a given API description. S Three main components/tools. S HTML/JavaScript code generator S Sphinx API doc generator S Python client stub generator
  • 11. HTML/JS Code Generator S Given an input API description, generates a set of API docs in HTML format. S Augments HTML-based API docs with JS/JQuery code to invoke the remote API on-line.
  • 12. System Architecture JSON Description Code Generator (Java/Velocity) API Documentation/ Client (HTML/JQuery) Reverse Proxy (NodeJS / Express) REST API (Tomcat)
  • 13. Sphinx API Doc Generator S Given an input API description, generates a collection of reStructred text (.rst) files and compiles them using Sphinx. S Generates an index page and a separate page for each resource and user-defined data type in the API description. S Automatically creates links between pages to provide easy navigation between related topics.
  • 14. Python Client Stub Generator S Given an input API description, generates a Python (2.7) module that can be used as a client stub (proxy) to consume the API. S Useful in developing desktop apps, command-line tools, webapps and mashups in Python. S Generates a separate Python class for each resource in the API description. S Convert API docs into Python docstrings.
  • 15. Challenges S Recursive type system is easy to understand but complex to generate code for. S Required vs. optional parameters. S Avoiding the generation of boilerplate code – Reusing generated code. S Handling different media types. S Managing symbols and identifiers during the code generation. S Handling incomplete API descriptions. S Cross-site API calls in JavaScript (Same origin policy)
  • 16. Future Work S Auto generating code for secured (OAuth, BasicAuth) APIs. S Auto generating test cases. S Generating code that validates/enforces documented API pre-conditions and post-conditions (contracts). S Support for more media types. S Auto generating entire apps/mashups.
  • 18. References S M. Maleshkova, C. Pedrinaci, and J. Domingue, “Investigating Web APIs on the World Wide Web”, European Conference on Web Services (ECOWS) S D. Bianchini, V. De Antonellis, and M. Melchiori, “Semantics-enabled web APIs selection pattern”, In Proceedings of the 15th Symposium on International Database Engineering & Applications (IDEAS '11) S Jacek Kopecký, Karthik Gomadam, and Tomas Vitvar. 2008, “hRESTS: An HTML Microformat for Describing RESTful Web Services” In Proceedings of the 2008 IEEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent Technology S WADL - http://www.w3.org/Submission/wadl/ S Swagger - https://developers.helloreverb.com/swagger/