摘要(英) |
In a cloud application, servers need to allow clients to access the data they require, and the interface through which servers and clients communicate is called an Application Programming Interface (API). In order to make the API user-friendly and easy to understand, it is usually necessary to write documentation that provides detailed explanations of its usage.
However, there are many challenges when writing API documentation. First, the content of the documentation is frequently incomplete or inconsistent with the actual functionality. Additionally, maintaining the documentation typically requires additional manpower, which can be difficult to allocate in small teams, resulting in increased workload and complexity for each individual and a higher likelihood of documentation errors.
On the other hand, after having an API, the server-side usually packages the API into a module called a Software Development Kit (SDK). However, developing an SDK is often a tedious task, so some teams resort to using code generators to generate the SDK.
But, current code generators, it still have many problems. For example, the generated code can be overly complex and not easily customizable according to specific requirements. Furthermore, making changes to the behavior of a code generator often requires a detailed study of official documentation and configurations.
To address these problems, this paper proposes an architecture that analyzes the backend code to generate API documentation and improve its readability. Additionally, we have developed a code generator that creates basic API interfaces and test data, providing developers who create SDKs with greater flexibility without being constrained by the code generator′s limitations. |
參考文獻 |
[1] Don Box, David Ehnebuske, Gopal Kakivaya, Andrew Layman, Noah Mendelsohn, Henrik Frystyk Nielsen, Satish Thatte, and Dave Winer. 2000. Simple Object Access Protocol (SOAP) 1.1. World Wide Web Consortium note (2000). Retrieved from http://www.w3.org/TR/200.
[2] L. Richardson and S. Ruby, RESTful Web Services, Sebastopol, CA, USA:O′Reilly Media, 2008..
[3] X. Wang, H. Zhao and J. Zhu, "GRPC: A Communication Cooperation Mechanism in Distributed Systems", ACM Operating System Review, vol. 27, no. 3, 1993..
[4] “Michael Meng, Stephanie Steinhardt, and Andreas Schubert. 2019. How developers use API documentation: an observation study. Commun. Des. Q. Rev 7, 2 (July 2019), 40–49. https://doi.org/10.1145/3358931.3358937”.
[5] "OpenAPI," [Online]. Available: https://www.openapis.org/. [Accessed 16 6 2023].
[6] “Wang, S., Tian, Y., & He, D. (2023). Improving API Documentation Comprehensibility via Continuous Optimization and Multilingual SDK. arXiv preprint arXiv:2303.13828.”.
[7] B. (. A. D. I. A. M. A. B. C. h.-1.-4.-1.-6. De, API Documentation.
[8] “A. Neumann, N. Laranjeiro and J. Bernardino, "An analysis of public REST Web service APIs", IEEE Trans. Services Comput., Jun. 2018.”.
[9] "OpenAPI Generator," [Online]. Available: https://openapi-generator.tech/. [Accessed 15 6 2023].
[10] "NSwag," [Online]. Available: https://github.com/RicoSuter/NSwag. [Accessed 12 6 2023].
[11] “L. Murphy, M. B. Kery, O. Alliyu, A. Macvean and B. A. Myers, "Api designers in the field: Design practices and challenges for creating usable apis", 2018 ieee symposium on visual languages and human-centric computing (vl/hcc), pp. 249-258, 2018.”.
[12] "RFC7321," [Online]. Available: https://www.rfc-editor.org/rfc/rfc7231#section-4.3.1. [Accessed 19 6 2023].
[13] "GraphQL," [Online]. Available: https://graphql.org/. [Accessed 13 6 2023].
[14] “R.T. Fielding, Architectural Styles and the Design of Network-Based Software Architectures, 2000.”.
[15] "https://swagger.io/," [Online]. [Accessed 19 6 2023].
[16] "https://raml.org/index.html," [Online]. [Accessed 20 6 2023].
[17] “Mandana Vaziri, Louis Mandel, Avraham Shinnar, Jérôme Siméon, and Martin Hirzel. 2017. Generating chat bots from web API specifications. In Proceedings of the 2017 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Program”.
[18] S. Editor, "Swagger Editor," [Online]. Available: https://editor.swagger.io/. [Accessed 10 6 2023].
[19] "SwaggerUI," [Online]. Available: https://swagger.io/tools/swagger-ui/.
[20] N. Y. N. U. 9. h. Hyunghun Cho and Sukyoung Ryu. 2014. REST to JavaScript for better client-side development. In Proceedings of the 23rd International Conference on World Wide Web (WWW ′14 Companion). Association for Computing Machinery.
[21] D. R. J. A. C. L. A. (. A. M.-D. M. f. F. B. C. W. S. f. O.-C. M. I. H. S. P. L. S. B. (. M.-D. E. a. S. D. Sferruzza.
[22] "Problems with Swagger," [Online]. Available: https://news.ycombinator.com/item?id=14035936. [Accessed 12 5 2023].
[23] “C. Gao and J. Wei, "Generating Open API Usage Rule from Error Descriptions," 2013 IEEE Seventh International Symposium on Service-Oriented System Engineering, San Francisco, CA, USA, 2013, pp. 245-253, doi: 10.1109/SOSE.2013.32.”.
[24] "Openapi-Generator GitHub Issues," [Online]. Available: https://github.com/OpenAPITools/openapi-generator/issues. [Accessed 22 6 2023].
[25] "NSwag GitHub Issues," [Online]. Available: https://github.com/RicoSuter/NSwag/issues. [Accessed 22 6 2022].
[26] A. Lauret, "6 reasons why generating OpenAPI from code when designing and documenting APIs sucks," 21 5 2021. [Online]. Available: https://apihandyman.io/6-reasons-why-generating-openapi-from-code-when-designing-and-documenting-apis-sucks/. [Accessed 28 5 2023].
[27] F. Z. E. a. C. K. R. ". B. U. F. A. t. U. o. A. 2. 1. W. C. o. R. E. L. I. 2. p. 1.-1. d. 1. M. F. Zibran.
[28] N. Y. N. U. 1. Douglas Kramer. 1999. API documentation from source code comments: a case study of Javadoc. In Proceedings of the 17th annual international conference on Computer documentation (SIGDOC ′99). Association for Computing Machinery.
[29] A. A. a. I. P. ". S. M. S. o. A. D. G. A. 2. 4. E. C. o. S. E. a. A. A. (. P. C. R. 2. p. 4.-4. d. 1. K. Nybom.
[30] ". A. D. F. i. I. S. v. 3. n. 4. p. 6.-7. J.-A. 2. d. 1. G. Uddin and M. P. Robillard.
[31] N. Kamal, API Documentation Generator, 2022.
[32] “C. Gao and J. Wei, "Generating Open API Usage Rule from Error Descriptions," 2013 IEEE Seventh International Symposium on Service-Oriented System Engineering, San Francisco, CA, USA, 2013, pp. 245-253, doi: 10.1109/SOSE.2013.32.”.
[33] "[BUG] Property with oneOf leads to wrong Typescript," [Online]. Available: https://github.com/OpenAPITools/openapi-generator/issues/14806. [Accessed 20 6 2023].
[34] “V. Atlidakis, P. Godefroid and M. Polishchuk, "Restler: Stateful REST API fuzzing", ACM/IEEE International Conference on Software Engineering (ICSE), 2019.”.
[35] “A. Martin-Lopez, S. Segura and A. Ruiz-Cortés, "RESTest: Automated Black-Box Testing of RESTful Web APIs", ACM Int. Symposium on Software Testing and Analysis (ISSTA), pp. 682-685, 2021.”. |