RestPi: Path-Sensitive Type Inference for REST APIs
Mark W. Aldrich, Kyla Levin, Michael Coblenz, Jeffrey S. Foster
Abstract
JEFFREY S. FOSTER, Tufts University, USA 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 REST ๐ 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.
CCS Concepts: โข Software and its engineering โ Data types and structures; Documentation.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 6d6dd1e5-2d6f-4d36-a61f-05d2b39c99cdBuilds on3
- Automated test generation for REST APIs: no time to rest yetMyeongsoo Kim, Qi Xin, Saurabh Sinha, Alessandro OrsoISSTA 2022 ยท 67 citations
- Type-directed program synthesis for RESTful APIsZheng Guo, David Cao, Davin Tjong, Jean Yang et al.PLDI 2022 ยท 15 citations
- Generating REST API Specifications through Static AnalysisRuikai Huang, Manish Motwani, Idel Martinez, Alessandro OrsoICSE 2024 ยท 11 citations
Related papers
- Speculate: Generating REST API Specifications using LLMsKrishanu Singh, Kushagra Karar, Abhilash Jindal, Guowei YangFSE 2026
- SATORI: Static Test Oracle Generation for REST APIsJuan C. Alonso, Alberto Martin-Lopez, Sergio Segura, Gabriele Bavota et al.ASE 2025 ยท 2 citations
- RESTOR: Automated Test Oracle Generation for RESTful APIs via Reinforcement LearningXun Zhou, Zhen Dong, Mingyu Ren, Qiang Li et al.ISSTA 2026
- DeepREST: Automated Test Case Generation for REST APIs Exploiting Deep Reinforcement LearningDavide Corradini, Zeno Montolli, Michele Pasqua, Mariano CeccatoASE 2024 ยท 13 citations
- Defects4REST: A Benchmark of Real-World Defects to Enable Controlled Testing and Debugging Studies for REST APIsRahil Mehta, Pushpak Katkhede, Manish MotwaniICSE 2026 ยท 1 citation
