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

Timestamp (Well known type) is written incorrectly #1

Open
csperl opened this issue Dec 5, 2020 · 2 comments
Open

Timestamp (Well known type) is written incorrectly #1

csperl opened this issue Dec 5, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@csperl
Copy link

csperl commented Dec 5, 2020

I have a proto with a google.protobuf.Timestamp field with the name date.
When calling TextFormatter I get the following text:

date {
"2020-12-04T12:40:43.910002200Z"
}

I get an exception when I try to parse this text again into the proto:
Expected string value for Timestamp.
It expects the following format:

date: "2020-12-04T12:40:43.910002200Z"

Parsing the textproto file worked after manually changing it.

I suggest to update the formatter and not the parser. The currently produced text is weird, because the braces indicate a complex type, but then they only contain a single value without a name.

@kerryjiang kerryjiang self-assigned this Dec 5, 2020
@kerryjiang kerryjiang added the bug Something isn't working label Dec 5, 2020
@csperl
Copy link
Author

csperl commented Jan 4, 2021

Any update?

@kerryjiang Are you working on a fix?

@kerryjiang
Copy link
Member

Could you try the new version I just released just now?
https://www.nuget.org/packages/Protobuf.Text/0.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants