arrow
Return

RestPi: Path-Sensitive Type Inference for REST APIs

delete2025-10-01
delete0
PRE
AI
M
Mark W. Aldrich *
K
Kyla H. Levin
M
Michael Coblenz
J
Jeffrey S. Foster
DOI:10.1145/3763055delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
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 pi, a type inference engine capable of automatically generating REST API specifications. The novel contribution of REST pi is our use of path-sensitive type inference, which encodes symbolic path-constraints directly into a type system. This allows REST pi 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 pi 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 pi 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.
Keywords:
Path-Sensitive Analysis
RESTful APIs
Type Inference

Journal

P
Proceedings of the ACM on Programming Languages-PACMPL
IF:
2.8
Papers:
308
Citations:
4.7K

Organization

T
Tufts University
Scholars:
237
Papers: 112
Citations: 2.5W
U
university of massachusetts system
Scholars:
3.8W
Papers: 3.5W
Citations: 42
U
University of Massachusetts Amherst
Scholars:
1.1W
Papers: 8.9K
Citations: 19
researcher View more organizations