错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

A probabilistic model for API contract specification retrieval focusing on the openAPI standard

  • Saeyoung Moon,
  • Gregor Kerr,
  • Fran Silavong,
  • Sean Moran

摘要

Designing a new API for a large-scale project requires developers to make strategic design choices that will allow the codebase to evolve sustainably. To create well-structured API components, developers can learn from existing APIs. However, the lack of standardized methods for comparing API designs often makes this learning process inefficient and challenging. To bridge this gap, we introduce API-Miner, which, to our knowledge, is one of the first engines to recommend API-to-API specifications. API-Miner retrieves relevant components from OpenAPI specifications-a widely recognized standard for describing web APIs. The engine introduces several key innovations: (1) novel techniques for processing and extracting critical information from OpenAPI specifications, (2) specialized feature extraction methods tailored to the technical domain of API specifications, and (3) a log-linear probabilistic model that integrates multiple signals to retrieve relevant and high-quality OpenAPI components based on a query specification. Through both quantitative and qualitative evaluations, API-Miner achieves a recall@1 of 91.7% and an F1 score of 56.2%, outperforming baseline models by 15.4 percentage points (pp) in recall@1 and 3.2 pp in F1. API-Miner enables developers to access relevant OpenAPI components from public or internal databases early in the API development cycle, facilitating the learning of best practices and the identification of potential redundancies. This tool helps streamline the development process and supports the creation of maintainable, high-quality APIs. The code for API-Miner is available at https://github.com/jpmorganchase/api-miner.