论文标题
Web API中参数依赖项的规范和自动分析
Specification and Automated Analysis of Inter-Parameter Dependencies in Web APIs
论文作者
论文摘要
Web服务通常会施加参数依赖关系,以限制可以将两个或多个输入参数组合在一起以形成对服务的有效调用的方式。不幸的是,诸如OpenAPI规范(OAS)之类的Web服务的当前规范语言对此类依赖性的正式描述不提供支持,这使得在没有人类干预的情况下自动发现和与服务互动是不可能的。在本文中,我们提出了一种对Web API中参数依赖性的规范和自动分析的方法。我们首先提出一种特定于域的语言,称为参数依赖语言(IDL),用于Web服务中输入参数之间的依赖项。然后,我们提出了一个映射,以将IDL文档转换为约束满意度问题(CSP),从而可以使用基于标准CSP的推理操作对IDL规范进行自动分析。具体来说,我们在IDL文档上介绍了九个分析操作的目录,例如,允许计算给定请求是否满足服务的所有依赖关系。最后,我们提出了一个工具套件,包括编辑,解析器,OAS扩展程序,约束编程库以及一个支持IDL规范及其分析的测试套件。这些贡献共同为在代码生成和测试等领域中的一系列规范驱动的应用程序铺平了道路。
Web services often impose inter-parameter dependencies that restrict the way in which two or more input parameters can be combined to form valid calls to the service. Unfortunately, current specification languages for web services like the OpenAPI Specification (OAS) provide no support for the formal description of such dependencies, which makes it hardly possible to automatically discover and interact with services without human intervention. In this article, we present an approach for the specification and automated analysis of inter-parameter dependencies in web APIs. We first present a domain-specific language, called Inter-parameter Dependency Language (IDL), for the specification of dependencies among input parameters in web services. Then, we propose a mapping to translate an IDL document into a constraint satisfaction problem (CSP), enabling the automated analysis of IDL specifications using standard CSP-based reasoning operations. Specifically, we present a catalogue of nine analysis operations on IDL documents allowing to compute, for example, whether a given request satisfies all the dependencies of the service. Finally, we present a tool suite including an editor, a parser, an OAS extension, a constraint programming-aided library, and a test suite supporting IDL specifications and their analyses. Together, these contributions pave the way for a new range of specification-driven applications in areas such as code generation and testing.