Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating Swagger Docs in Firebase Cloud Functions project

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 serverless, so wondering if this is possible.

like image 247
Ayyappa Avatar asked Mar 30 '18 11:03

Ayyappa


2 Answers

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.

like image 171
Tim Kofoed Avatar answered Nov 03 '22 15:11

Tim Kofoed


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.

like image 1
Jonathan Avatar answered Nov 03 '22 17:11

Jonathan