Generating a Formalized REST API Definition Language for a Dynamic Framework Without Annotations Using Static Analysis Tools
Daria S. Usova · 2023
Documentation plays an important role in the process of software development. It is a document that refers to the information necessary for the software development, maintenance and support. Application program interface or API documentation intended for developers who want to use documented software in their product. It gives a formal description of the program input and output. It is most popular for server-client applications. For the successful execution of the request, the client needs to know the server's API, which often changes. It is difficult for server developers to write documentation for each change, moreover the client is not required to investigate the server source code, besides that it is not always available. Such a situation illustrates that automatic API documentation generation is necessary. Two popular approaches of automatic documentation generation are static and dynamic code analysis. First method analyzes some code representation, for example syntax tree, without actually executing it. The main flaw of such an approach is that they usually use only information from classes, method signatures and annotations. It is not acceptable for libraries which place important information in the method's body. By contrast, dynamic methods require running an application for analysis to make some test requests. The complexity of test generation which will cover all possible code behavior is a fundamental problem for this approach. In this paper, we introduce an approach of automatic API documentation generation based on a syntax tree analysis of server code written on framework KTOR.