Generating Swagger Docs in Firebase Cloud Functions project

后端 未结 2 895
走了就别回头了
走了就别回头了 2021-02-07 08:35

Is it possible to generate Swagger Spec file from function comments in firebase cloud functions? If so, how can we do it?

I see the cloud functions code to be more like

相关标签:
2条回答
  • 2021-02-07 09:12

    I haven't found an automatic way, but there are plenty of libraries to choose from.

    I'm using express and nodejs in my Firebase Function implementations, and for me, Swagger doc generation can be implemented via the following libraries: https://github.com/scottie1984/swagger-ui-express https://github.com/Surnet/swagger-jsdoc

    You can find other libraries at: https://swagger.io/tools/open-source/open-source-integrations/

    This will create a new HTTP endpoint, which will serve an HTML page of a swagger doc.

    0 讨论(0)
  • 2021-02-07 09:26

    There is not an automatic way to do this at this time. I think you could build your own but seems like it would be a lot of work.

    0 讨论(0)
提交回复
热议问题