postman-app-support icon indicating copy to clipboard operation
postman-app-support copied to clipboard

gRPC: Timestamp and Duration types (google.protobuf) should be represented in string in JSON.

Open zzJinux opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the tracker for existing similar issues and I know that duplicates will be closed

Describe the Issue

According to the official documentation and various well-known protobuf libraries, JSON representations of google.protobuf.Timestamp and google.protobuf.Duration are "string":

  • https://protobuf.dev/reference/protobuf/google.protobuf/
  • https://protobuf.dev/reference/java/api-docs/com/google/protobuf/Timestamp
  • https://protobuf.dev/reference/java/api-docs/com/google/protobuf/Duration

Postman, on the other hand, treats them as a JSON object.

Steps To Reproduce

Try invoking any gPRC method that accepts or returns Timestamp or Duration types. Postman expects {"seconds": 1, "nanos": 0} but complains on "1s" for Duration fields.

Screenshots or Videos

No response

Operating System

macOS

Postman Version

10.22.9

Postman Platform

Postman App

User Account Type

Signed Out User

Additional Context?

No response

zzJinux avatar Feb 03 '24 08:02 zzJinux

Hey @zzJinux !

Thanks for reporting the issue. This seems to be stemming from an underlying package we use. We'll take a look at this and share more details soon.

appurva21 avatar Feb 05 '24 06:02 appurva21

Hi, are there any updates regarding this?

TilGP avatar Sep 11 '24 08:09 TilGP

@TilGP Let's thumb up!

zzJinux avatar Sep 28 '24 17:09 zzJinux

Thanks for reporting this!

This issue has been fixed in Postman v11.67.0. 🎉 Postman now correctly follows the canonical JSON representations for Google's well-known types — Struct, Duration, and Timestamp — in both request payloads and responses.

This update brings Postman in line with the official protoJSON specification.

Please update to the latest version to get the fix, and feel free to reopen this issue if you continue to experience any problems.

Image

ankurdengla avatar Oct 13 '25 14:10 ankurdengla