Documentation is misleading - Topic.createSubscription Subscription name is not optional #59
Labels
api: pubsub
Issues related to the googleapis/nodejs-pubsub API.
docs
priority: p2
Moderately-important priority. Fix may not be included in next release.
🚨
This issue needs some love.
triaged for GA
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
I was trying to create a subscription with no name after reading some older threads in the old github (googleapis/google-cloud-node#1257 & googleapis/google-cloud-node#1799), especially about allowing subscription to get random names if no name was provided.
The documentation seems to be wrong on that particular point: https://cloud.google.com/nodejs/docs/reference/pubsub/0.16.x/Topic#createSubscription
In the table it says that the subscription name is an optional parameter, but in reality it will throw an error (which is actually explicitly specified in the Throws section of the documentation).
It's the same in the Subscription documentation: https://cloud.google.com/nodejs/docs/reference/pubsub/0.16.x/Subscription
Also, just to be sure, could you point me towards the PR that made the subscription name mandatory or what was the reasoning behind that ? In the scenario I'm in, it would be nice to have the possibility to have random / unique subscriptions to a topic, from what I read it was possible at some point so I'm curious to know why it was removed ? Thank you.
Environment details
The text was updated successfully, but these errors were encountered: