raystack / raccoon

Raccoon is a high-throughput, low-latency service to collect events in real-time from your web, mobile apps, and services using multiple network protocols.
https://raystack.github.io/raccoon/
Apache License 2.0
199 stars 29 forks source link

Fix: JSON deserialiser #66

Closed punit-kulal closed 1 year ago

punit-kulal commented 1 year ago

Bug: json message isn't correctly serialised, even when published in protobuf compliant JSON format.

Context:

  1. Protobuf style guide states that JSON keys should be in camelCase, and protobuf keys/field names should be in snake_case.
  2. Thus, when a Request Payload is serialised. It uses CamelCase.
  3. However, since raccoon uses standard encoding/json package to deserialise, it does not correctly deserialise camelCase keys of Json.

Fix:

  1. Start using protobuf's official encoding/protojson package for deserialisation.
  2. It adhere's to the style guide of protobuf, which supports deserialisation of both snake_case and camelCase keys in JSON.
punit-kulal commented 1 year ago

Closing due to large scope and backward incompatibility. Refer