IDLGen: Automated Code Generation for Inter-parameter Dependencies in Web APIs

SERVICE-ORIENTED COMPUTING, ICSOC 2023, PT I(2023)

引用 0|浏览2
暂无评分
摘要
The generation of code templates from web API specifications is a common practice in 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 IDLGen, an approach for the automated generation of validation 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 web APIs. Evaluation results show the effectiveness of the approach in accelerating the development of APIs, generating up to 9.4 times more lines of Java code than the current generator. This leads to average time savings ranging from 16 to 24 min when implementing API operations including between one and three dependencies, when compared to manual coding. More importantly, the generated code mitigates human errors, making web APIs significantly more reliable.
更多
查看译文
关键词
Web APIs,Open API and Scaffolding,Code generation
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要