Skip to content

Conversation

@europaul
Copy link
Contributor

I was wondering for a long time why msgid is marshalled as a string, while it's defined as int64. Turns out that protojson.Marshal converts all int64 to string according to the protobuf spec.

I find this peculiar, so I decided to use json.Marshal instead. We'll only use this for printing, to avoid compatibility issues.

As can be seen here it's a known issue and is by design.

@europaul europaul requested a review from uncleDecart as a code owner July 16, 2025 13:42
@europaul
Copy link
Contributor Author

/rerun red

@europaul
Copy link
Contributor Author

@uncleDecart could you please restart the tests here?

I was wondering for a long time why msgid is marshalled as a string,
while it's defined as int64. Turns out that protojson.Marshal
converts all int64 to string according to the protobuf spec.

I find this peculiar, so I decided to use json.Marshal instead.
We'll only use this for printing, to avoid compatibility issues.

Signed-off-by: Paul Gaiduk <[email protected]>
@europaul europaul force-pushed the json-instead-of-protojson branch from 123c3a3 to 83a9c34 Compare September 18, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant