Generating Swagger Docs in Firebase Cloud Functions project

后端 未结 2 897
走了就别回头了
走了就别回头了 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.

提交回复
热议问题