'Subscription.name has already been set error' occurring PubSub Emulator #249
Labels
api: pubsub
Issues related to the Pub/Sub API.
🚨
This issue needs some love.
triage me
I really want to be triaged.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
This error occurs in the PubSub emulator when trying to create a subscription with some standard code. Example code with reproduction steps in comment: [1]
After some investigation it looks like the problem is a bug in the Pub/Sub client library that causes the subscription name to be included twice in the JSON. In the API reference[2] 'name' is listed as a path parameter but it's also available as an option to be included in the request body. We've tried calling the API using curl and confirmed that the error only occurs when name is included in the request body. There appears to be a discrepancy between how Pub/Sub behaves on production as it accepts both variants while the emulator fails with a repeated 'name'.
I've tried rolling back to previous versions of the client library but the issue still occurs.
[1] http://pastebin.com/awT5km9Z
[2]https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/create
The text was updated successfully, but these errors were encountered: