-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Unparseable JSON in output #7396
Comments
Most likely, I don't think we would ever reorder fields in proto /cc @heyitsanthony @xiang90 ? |
It depends on whatever the go json encoder does. So long as it's building with the same go version it should be stable. The JSON fields can be made strings but protoc will need to generate a json field tag that coerces it into a string. |
i would rather stay at the default Porto to Json mapping standard. |
Sorry, to be more clear - I am munging the simple output for now:
Is the ordering going to remain static? Or should I ship a 6MB binary built with Go to parse the JSON. |
Simple is stable. We won't break it without clear communication and deprecation plan. |
When I run
etcdctl endpoint status -w json
I get this output:Most implementations of JSON parsers are not going to understand this JSON - the integers are too large to be represented as 64-bit float without losing precision. I'd recommend exposing the IDs as a string. I ran into this yesterday when using the
jq
utility.All of JavaScript is 64-bit float so most implementations of JSON parsers are implicitly the same, since the spec explicitly does not define any behavior ("JSON is agnostic about numbers").
I am munging the simple output for now, can you provide any guarantees that the output ordering will remain consistent for all releases
3.1.X
?The text was updated successfully, but these errors were encountered: