paperbot · PL 论文追踪

全部论文 待读 收藏

P2 RestPi: Path-Sensitive Type Inference for REST APIs

RestPi:面向 REST API 的路径敏感类型推断
OOPSLA 9(OOPSLA2)2025匹配度 3/10 · 论文属于静态类型推断/类型系统,路径敏感类型推断与 PL 侧静态分析方法有弱关联;但其应用领域是 Ruby REST API 规约生成,不涉及 LLM/Agent、浮点程序分析、贝叶斯程序分析或 AI 与 PL 的交叉,因此与用户核心研究方向匹配度低。引用 1 inbox
Mark W. Aldrich, Kyla H. Levin, Michael Coblenz, Jeffrey S. Foster
crossref: 2026-09-10

AI 速览

一句话:提出路径敏感类型推断引擎 RestPi,为 Ruby REST API 自动生成更精确完整的响应类型规约。

REST API 规范应清晰描述所有响应类型,但现有工具难以自动生成此类规范。本文提出 RestPi,一个可自动生成 REST API 规范的类型推断引擎。其核心创新是路径敏感类型推断:将符号路径约束直接编码进类型系统,从而沿端点实现的每条不同执行路径枚举响应类型。作者为 Ruby(常用于 REST API 服务器)实现了该推断。评估在 5 个开源 REST API 实现的 132 个端点上进行,不依赖已有规范或测试套件;结果表明 RestPi 推断高效,且生成的类型比 HTTP 代理所得更精确、更完整。结果显示路径敏感性是枚举 REST 端点不同响应类型的关键技术。

问题
REST API 规范应完整描述响应类型,但自动生成规范仍很困难,现有工具难以枚举端点的所有响应类型。
方法
RestPi 将符号路径约束编码进类型系统,进行路径敏感类型推断,并针对 Ruby 实现,沿端点实现的不同执行路径枚举响应类型。
评估
在 5 个开源 REST API 实现的 132 个端点上评估,不使用已有规范或测试套件,并与 HTTP 代理对比,显示推断高效且类型更精确完整。
原文摘要(Abstract)

REST APIs form the backbone of modern interconnected systems by providing a language-agnostic communication interface. REST API specifications should clearly describe all response types, but automatically generating specifications is difficult with existing tools. We present REST π , a type inference engine capable of automatically generating REST API specifications. The novel contribution of RES’ffi is our use of path-sensitive type inference, which encodes symbolic pathconstraints directly into a type system. This allows REST π to enumerate all response types by considering each distinct execution path through an endpoint implementation. We implement path-sensitive type inference for Ruby, a popular language used for REST API servers. We evaluate REST π by using it to infer types for 132 endpoints across 5 open-source REST API implementations without utilizing existing specifications or test suites. We find REST π performs type inference efficiently and produces types that are more precise and complete than those obtained via an HTTP proxy. Our results suggest that path-sensitivity is a key technique to enumerate distinct response types for REST endpoints.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2880,
  title = {RestPi: Path-Sensitive Type Inference for REST APIs},
  author = {Mark W. Aldrich and Kyla H. Levin and Michael Coblenz and Jeffrey S. Foster},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763055}
}