是否可以从Firebase云函数中的函数注释生成Swagger Spec文件?如果是这样,我们该怎么做?
我看到云功能代码更像是无服务器的,所以想知道这是否可能。
最佳答案
我还没有找到一种自动方式,但是有很多库可供选择。
我在Firebase Function实现中使用express和nodejs,对我来说,
可以通过以下库来实现Swagger文档生成:
https://github.com/scottie1984/swagger-ui-express
https://github.com/Surnet/swagger-jsdoc
您可以在以下位置找到其他库:
https://swagger.io/tools/open-source/open-source-integrations/
这将创建一个新的HTTP终结点,该终结点将服务于招摇文档的HTML页面。
关于firebase - 在Firebase Cloud Functions项目中生成Swagger文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49573560/