From OpenAPI Fragments to API Pattern Primitives and Design Smells

In the past few years, the OpenAPI Specification (OAS) has emerged as a standard description language for accurately modeling Web APIs. Today, thousands of OpenAPI descriptions can be found by mining open source repositories. In this paper, we attempt to exploit these artifacts to extract commonly occurring building blocks used in Web API structures, in order to assist Web API designers in their modelling task. Our work is based on a fragmentation mechanism, that starts from OpenAPI descriptions of Web APIs to extract their structures, then fragment these structures into smaller blocks. This approach enabled us to extract a large dataset of reoccurring fragments from a collection of 6619 API specifications. Such fragments have been found multiple times in the same or across different APIs. We have classified the most reoccurring fragments into four pattern primitives used to expose in the API access to collections of items. We distinguish for each primitive variants from design smells. This classification is based on the specific combinations of operations associated with the collection items and on an in-depth analysis of their natural language labels and descriptions. The resulting pattern primitives are intended to support designers who would like to introduce one or more collections for a specific class of items in their HTTP-based API.

[1]  Olaf Zimmermann,et al.  Interface Representation Patterns: Crafting and Consuming Message-Based Remote APIs , 2017, EuroPLoP.

[2]  Uwe Zdun,et al.  A catalog of architectural primitives for modeling architectural patterns , 2008, Inf. Softw. Technol..

[3]  Frank Leymann,et al.  API governance support through the structural analysis of REST APIs , 2018, Computer Science - Research and Development.

[4]  Savas Parastatidis,et al.  REST in Practice - Hypermedia and Systems Architecture , 2010 .

[5]  Sam Ruby,et al.  RESTful Web Services , 2007 .

[6]  Gregor Hohpe,et al.  Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions , 2003 .

[7]  Yann-Gaël Guéhéneuc,et al.  Detection of REST Patterns and Antipatterns: A Heuristics-Based Approach , 2014, ICSOC.

[8]  Robert Daigneau,et al.  Service Design Patterns: Fundamental Design Solutions for SOAP/WSDL and RESTful Web Services , 2011 .

[9]  Martin Fowler,et al.  Patterns of Enterprise Application Architecture , 2002 .

[10]  Önder Babur,et al.  Using n-grams for the Automated Clustering of Structural Models , 2017, SOFSEM.

[11]  Fabio Casati,et al.  REST APIs: A Large-Scale Analysis of Compliance with Principles and Best Practices , 2016, ICWE.

[12]  Sanjay Patni,et al.  Pro RESTful APIs , 2017 .

[13]  Cesare Pautasso,et al.  Data-Oriented Interface Responsibility Patterns: Types of Information Holder Resources , 2020, EuroPLoP.

[14]  Yann-Gaël Guéhéneuc,et al.  Are REST APIs for Cloud Computing Well-Designed? An Exploratory Study , 2016, ICSOC.

[15]  innoQ Deutschland,et al.  A Pattern Language for RESTful Conversations , 2017 .

[16]  O. Zimmermann,et al.  Introduction to Microservice API Patterns (MAP) , 2019, Microservices.

[17]  Uwe Zdun,et al.  Remoting patterns - foundations of enterprise, internet and realtime distributed object middleware , 2004, Wiley series in software design patterns.

[18]  Cesare Pautasso,et al.  Interface Responsibility Patterns: Processing Resources and Operation Responsibilities , 2020, EuroPLoP.

[19]  Ralf Klamma,et al.  The Exploitation of OpenAPI Documentation for the Generation of Web Frontends , 2018, WWW.