Sassan
Sassan

Reputation: 2337

Inconsistency of the default database name in different resource urls

The default database in the console URL is written as -default- like this:

https://console.firebase.google.com/project/${param:PROJECT_ID}/firestore/databases/-default-/data/~2F${param:FIRESTORE_COLLECTION}

while it is written as (default) in the extension.yaml's resources[].properties.eventTrigger.resource like this:

projects/${param:PROJECT_ID}/databases/(default)/documents/${param:FIRESTORE_COLLECTION}/{id}

Now the issue is if I want to make it a parameter of my extension, if I set its default value as (default) or if the user sets it to (default), it will have the correct value in extension.yaml file but I can't put a link to the Firestore console in my POSTINSTALL.md, and if I use -default- as the default value or the user sets it to -default- it will not work for the extension.yaml.

The solutions coming to my mind would be:

  1. Firebase adds a redirect of (default) to -default for the database name in the console url.
  2. I set the default value to an empty value and Firebase extensions adds a mechanism to provide a default value for ${Param:...} clauses so that I can write ${Param:DATABASE_NAME:"(default)"} in extension.yaml and ${Param:DATABASE_NAME:"-default-"} in POSTINSTALL.md.

Context: I'm trying to implement this feature

Upvotes: 0

Views: 21

Answers (0)

Related Questions