Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Documentation is misleading - Topic.createSubscription Subscription name is not optional  #59

@jeremy-albuixech

Description

@jeremy-albuixech

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

  • OS: Ubuntu 16.04
  • Node.js version: 8.9.4
  • npm version: 5.5.1
  • @google-cloud/pubsub version: 0.16.2

Metadata

Metadata

Labels

🚨This issue needs some love.api: pubsubIssues related to the googleapis/nodejs-pubsub API.docspriority: p2Moderately-important priority. Fix may not be included in next release.triaged for GAtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions