Byron / google-apis-rs

A binding and CLI generator for all Google APIs
http://byron.github.io/google-apis-rs
Other
1.01k stars 131 forks source link

Failed to deserialize messages from pubsub #444

Open omer-shtivi opened 11 months ago

omer-shtivi commented 11 months ago

Crate version: 5.0.3 serde_json = "1.0.107" serde: 1.0.188 Seems like PullResponse is unable to deserialize the message

Getting the following error:

fail to fetch message from pubsub PubsubError("JsonDecodeError(\"{\\n  \\\"receivedMessages\\\": [\\n    {\\n      \\\"ackId\\\": \\\"RVNEUAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRELUxNRXHUeSBBgXzN1B1ENGXN1MCA5UkFSBxBUdF9RGx9ZXESx_4iVL1BdaXZoUxAJCkNbfF1dGgprX3SJlJWirMqMV29WYtf5291lXpbVvOZZZiE9XBJLLD5-KzJFQV5AEkwgB0RJUytDCypYEU4EISE-MD4\\\",\\n      \\\"message\\\": {\\n        \\\"data\\\": \\\"data\\\",\\n        \\\"attributes\\\": {\\n          \\\"destination\\\": \\\"dev-gcp-us-east1-omer1\\\",\\n          \\\"publisher_pod\\\": \\\"satori-management-server-api-69764c4d4c-gqhb9\\\",\\n          \\\"publisher_project\\\": \\\"stage-1-258821\\\"\\n        },\\n        \\\"messageId\\\": \\\"8329388682261733\\\",\\n        \\\"publishTime\\\": \\\"2023-10-01T18:41:37.770Z\\\"\\n      }\\n    }\\n  ]\\n}\\n\", Error(\"Invalid byte 43, offset 85.\", line: 6, column: 614))")
Byron commented 11 months ago

This is most certainly related to #442, which in turn is related to a change that adjusted the decoding of certain fields so it works for one API, but apparently breaks it for many others. This can, and should, be enabled or handled on a per-API basis, which is possible but needs contribution.