Skip to content

PubSub Message does not allow numbers #1899

@tacticurv

Description

@tacticurv

If the JSON object in the attributes contains a number, an error is thrown as follows.

Step 3 : Error  Error: Illegal value for [object Object] of type string: number (not a string)
                 at Error (native)
                 at fail (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:1801:23)
                 at Element.ProtoBuf.Reflect.ElementPrototype.verifyValue (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:1863:25)
                 at new Map (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:4942:46)
                 at T.ProtoBuf.Reflect.FieldPrototype.verifyValue (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:3465:28)
                 at MessagePrototype.set (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:2475:59)
                 at MessagePrototype.set (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:2466:38)
                 at Message (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:2395:34)
                 at Element.ProtoBuf.Reflect.ElementPrototype.verifyValue (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:1909:28)
                 at T.ProtoBuf.Reflect.FieldPrototype.verifyValue (.../node_modules/google-cloud/node_modules/protobufjs/dist/protobuf.js:3455:43)

Environment details - From where the message was generated

  • OS: Ubuntu 14.04
  • Node.js version: 6.9.2
  • npm version: 3.10.9
  • google-cloud-node version: 0.45.1

Steps to reproduce

  1. require google-cloud
  2. topic.publish({data : "...", attributes : message}, options, function(err) {
    ...
    });
    where message is a JSON object and options have raw enabled to true.

Metadata

Metadata

Labels

api: pubsubIssues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions