Skip to main content
Top

2023 | OriginalPaper | Chapter

Specification-Driven Code Generation for Inter-parameter Dependencies in Web APIs

Authors : Saman Barakat, Enrique Barba Roque, Ana Belén Sánchez, Sergio Segura

Published in: Service-Oriented Computing – ICSOC 2022 Workshops

Publisher: Springer Nature Switzerland

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

The generation of code templates from web API specifications is a common practice in the software industry. However, existing tools neglect the dependencies among input parameters (so called inter-parameter dependencies), extremely common in practice and usually described in natural language. As a result, developers are responsible for implementing the corresponding validation logic manually, a tedious and error-prone process. In this paper, we present an approach for the automated generation of code for inter-parameter dependencies in web APIs. Specifically, we exploit the IDL4OAS extension for specifying inter-parameter dependencies as a part of OpenAPI Specification (OAS) files. To make our approach applicable in practice, we present an extension of the popular OpenAPI Generator tool ecosystem, automating the generation of Java and Python code for the management of inter-parameter dependencies in both servers and clients. Evaluation results show the effectiveness of the approach in accelerating the development of APIs, generating up to 9.4 times more code than current generators, while making APIs potentially more reliable.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Literature
4.
go back to reference Deljouyi, A., Ramsin, R.: Mdd4rest: model-driven methodology for developing restful web services. In: MODELSWARD, pp. 93–104. Scitepress (2022) Deljouyi, A., Ramsin, R.: Mdd4rest: model-driven methodology for developing restful web services. In: MODELSWARD, pp. 93–104. Scitepress (2022)
6.
go back to reference Ed-Douibi, H., Izquierdo, J.L.C., Gómez, A., Tisi, M., Cabot, J.: EMF-REST: generation of restful APIs from models. In: Proceedings of the 31st Annual ACM Symposium on Applied Computing, 04–08 April 2016, pp. 1446–1453. Association for Computing Machinery (2016) Ed-Douibi, H., Izquierdo, J.L.C., Gómez, A., Tisi, M., Cabot, J.: EMF-REST: generation of restful APIs from models. In: Proceedings of the 31st Annual ACM Symposium on Applied Computing, 04–08 April 2016, pp. 1446–1453. Association for Computing Machinery (2016)
7.
go back to reference Fielding, R.T.: Rest: architectural styles and the design of network-based software architectures. Doctoral dissertation, University of California (2000) Fielding, R.T.: Rest: architectural styles and the design of network-based software architectures. Doctoral dissertation, University of California (2000)
10.
go back to reference Gómez, O.S., Rosero, R.H., Cortés-Verdín, K.: CRUDyleaf: A DSL for generating spring boot rest APIs from entity crud operations. Cybern. Inf. Technol. 20(3), 3–14 (2020) Gómez, O.S., Rosero, R.H., Cortés-Verdín, K.: CRUDyleaf: A DSL for generating spring boot rest APIs from entity crud operations. Cybern. Inf. Technol. 20(3), 3–14 (2020)
12.
go back to reference Li, L., Chou, W.: Design and describe rest API without violating rest: a petri net based approach. In: 2011 IEEE International Conference on Web Services, pp. 508–515 (2011) Li, L., Chou, W.: Design and describe rest API without violating rest: a petri net based approach. In: 2011 IEEE International Conference on Web Services, pp. 508–515 (2011)
13.
go back to reference Li, L., Tang, T., Chou, W.: Automated creation of navigable REST services based on REST chart. J. Adv. Manag. Sci. 4, 385–392 (2016)CrossRef Li, L., Tang, T., Chou, W.: Automated creation of navigable REST services based on REST chart. J. Adv. Manag. Sci. 4, 385–392 (2016)CrossRef
14.
go back to reference Martin-Lopez, A., Segura, S., Muller, C., Ruiz-Cortes, A.: Specification and automated analysis of inter-parameter dependencies in web APIs. IEEE Trans. Serv. Comput. 15(4), 1–14 (2021) Martin-Lopez, A., Segura, S., Muller, C., Ruiz-Cortes, A.: Specification and automated analysis of inter-parameter dependencies in web APIs. IEEE Trans. Serv. Comput. 15(4), 1–14 (2021)
15.
go back to reference Martin-Lopez, A., Segura, S., Ruiz-Cortés, A.: A catalogue of inter-parameter dependencies in restful web APIs. In: Yangui, S., Bouassida Rodriguez, I., Drira, K., Tari, Z. (eds.) Service-Oriented Computing, pp. 399–414. Springer International Publishing, Cham (2019)CrossRef Martin-Lopez, A., Segura, S., Ruiz-Cortés, A.: A catalogue of inter-parameter dependencies in restful web APIs. In: Yangui, S., Bouassida Rodriguez, I., Drira, K., Tari, Z. (eds.) Service-Oriented Computing, pp. 399–414. Springer International Publishing, Cham (2019)CrossRef
16.
go back to reference Martin-Lopez, A., Segura, S., Ruiz-Cortés, A.: RESTest: black-box constraint-based testing of restful web APIs. In: Kafeza, E., Benatallah, B., Martinelli, F., Hacid, H., Bouguettaya, A., Motahari, H. (eds.) Service-Oriented Computing, pp. 459–475. Springer International Publishing, Cham (2020)CrossRef Martin-Lopez, A., Segura, S., Ruiz-Cortés, A.: RESTest: black-box constraint-based testing of restful web APIs. In: Kafeza, E., Benatallah, B., Martinelli, F., Hacid, H., Bouguettaya, A., Motahari, H. (eds.) Service-Oriented Computing, pp. 459–475. Springer International Publishing, Cham (2020)CrossRef
24.
go back to reference Queirós, R.: Kaang: a restful api generator for the modern web. In: 7th Symposium on Languages, Applications and Technologies SLATE 2018, vol. 62, pp. 1:1–1:15. Schloss Dagstuhl-Leibniz-Zentrum für Informatik (2018) Queirós, R.: Kaang: a restful api generator for the modern web. In: 7th Symposium on Languages, Applications and Technologies SLATE 2018, vol. 62, pp. 1:1–1:15. Schloss Dagstuhl-Leibniz-Zentrum für Informatik (2018)
27.
go back to reference Rossi, D.: UML-based model-driven REST API development. In: WEBIST 2016 - Proceedings of the 12th International Conference on Web Information Systems and Technologies, pp. 194–201 (2016) Rossi, D.: UML-based model-driven REST API development. In: WEBIST 2016 - Proceedings of the 12th International Conference on Web Information Systems and Technologies, pp. 194–201 (2016)
29.
go back to reference Wang, B., Rosenberg, D., Boehm, B.W.: Rapid realization of executable domain models via automatic code generation. In: 2017 IEEE 28th Annual Software Technology Conference (STC), pp. 1–6 (2017) Wang, B., Rosenberg, D., Boehm, B.W.: Rapid realization of executable domain models via automatic code generation. In: 2017 IEEE 28th Annual Software Technology Conference (STC), pp. 1–6 (2017)
Metadata
Title
Specification-Driven Code Generation for Inter-parameter Dependencies in Web APIs
Authors
Saman Barakat
Enrique Barba Roque
Ana Belén Sánchez
Sergio Segura
Copyright Year
2023
DOI
https://doi.org/10.1007/978-3-031-26507-5_21

Premium Partner