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.
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.
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.
Related
I'm trying to use the firebase ML language identifier. Whenever I type something in Hebrew, I get back the language code 'iw' instead of 'he'. I tried to look for the API or the meaning of the 'iw' code in the documentation, but couldn't find anything.
"iw" is an old code which was changed to "he" in 1989.
see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
We made some changes to Firebase ML Kit to better distinguish the on-device APIs from cloud based APIs. "ML Kit"(without firebase branding) contains all the on-device APIs. Here's the migration guide from firebase mlkit to mlkit.
In the standalone mlkit, we are using he instead of iw for Hebrew.
Is it possible to use "Callable Functions" together with AngularFire2?
Since AngularFireModule already calls initializeApp, I am not sure how to follow the instructions here?
I guess I should not call initializeApp() multiple times?
AngularFire2 is built on top of the regular Firebase JavaScript SDK. That means that anything that's possible in the JavaScript SDK, is also possible from within AngularFire2. If the action is related to showing data from Firebase in UI elements, there may be a wrapper from AngularFire. But even if there is no wrapper, you can access the JavaScript SDK directly.
So: Yes, it is possible to invoke Callable Cloud Functions from AngularFire2. You should indeed only initialize the app once, unless you're trying to access multiple projects.
If you're having trouble making this work, post the minimal, complete code that reproduces where you're stuck.
I am using Firebase in my project, including Firestore.
The docs say when setting up Firestore to include firebase-firestore.js in addition to the normal firebase.js file.
Is this required? I included it, but am also looking to reduce dependencies whenever possible.
Yes, it's required. firebase.js contains common code for all Firebase products you might use.
I would like to use Firebase analytics for one of my library modules. I would like to program in such a way that configuration file (google-services.json) should be accessible from either client app folder or configure the same from the client side.
Is there a way I could implement the above mentioned scenario?
Thanks in advance.
You can initialize your library project configurations manually as below,
For more info, kindly refer working-with-multiple-firebase-projects-in-an-android-app
Also go-through how-does-firebase-initialize-on-android to understand; how the Firebase module is getting initialized by itself.
For Android apps using Firebase, there is a central FirebaseApp object
that manages the configuration for all the Firebase APIs. This is
initialized automatically by a content provider when your app is
launched, and you typically never need to interact with it. However,
when you want to access multiple projects from a single app, you'll
need a distinct FirebaseApp to reference each one individually. It's
up to you to initialize the instances other than the default that
Firebase creates for you.
FirebaseOptions options = new FirebaseOptions.Builder()
.setApplicationId("1:530266078999:android:481c4ecf3253701e") // Required for Analytics.
.setApiKey("AIzaSyBRxOyIj5dJkKgAVPXRLYFkdZwh2Xxq51k") // Required for Auth.
.setDatabaseUrl("https://project-1765055333176374514.firebaseio.com/") // Required for RTDB.
.build();
FirebaseApp.initializeApp(this /* Context */, options, "secondary");
Hope I've answered your question.
I've found interesting workaround. Try the following:
put your google-services.json to any sample app google provides for Firebase integration. Compile it.
Take a look on path app/build/generated/res/google-services/debug/values/ there should be generated values.xml file with bunch of strings mentioned in errors you described. Copy these strings to value.xml file of your project. That's it.
I would like to backup a number of the AWS Stacks' Custom JSON files. I can't seem to find an API that will extract them for me. Is there an applicable API available? If so, what?
I Assume you are using CloudFormation:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-get-template.html