Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/prototext: Handle well-known Timestamp message as string #1582

Open
calmh opened this issue Dec 21, 2023 · 1 comment
Open

encoding/prototext: Handle well-known Timestamp message as string #1582

calmh opened this issue Dec 21, 2023 · 1 comment

Comments

@calmh
Copy link

calmh commented Dec 21, 2023

Currently, there is no special handling for timestamps. A timestamp field in a message is marshalled as seconds and nanoseconds:

created_at {
  seconds: 1703153845
  nanos: 392723000
}

For human consumption I think it would be nicer if timestamps were represented as strings:

created_at: "2023-12-21T10:17:25.392723Z"

Presumably, unmarshalling could support both variants.

@cybrcodr
Copy link
Contributor

The prototext package follows the protocol buffer Text Format Language Specification. And that specification does not provide any special handling for well-known types.

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

No branches or pull requests

2 participants