We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following thrift struct:
struct TestStruct { 1: optional map<i64, string> map; }
When I serialize it with JsonThriftSerializer:
import com.twitter.scrooge.JsonThriftSerializer val testStruct = TestStruct(Some(Map(1L -> ""))) val serializer = JsonThriftSerializer(TestStruct) serializer.toString(testStruct)
I expect to get:
{"map":{"1":""}}
I actually get:
{"map":{1:""}}
which is not valid json. For instance attempting to parse with jq:
$ echo '{"map":{1:""}}' | jq . parse error: Object keys must be strings at line 1, column 10
The text was updated successfully, but these errors were encountered:
We are actually just calling through to Thrift's JSON support, which it appears is broken.
Two ways forward:
Figure out if the thrift was fixed in a later version.
Write our own TProtocol that does a better job here.
Sorry, something went wrong.
I'd be happy to help someone tackle either of 1 or 2.
@johnynek do you remember what the denouement of this issue was on your end?
No branches or pull requests
Consider the following thrift struct:
When I serialize it with JsonThriftSerializer:
I expect to get:
I actually get:
which is not valid json. For instance attempting to parse with jq:
The text was updated successfully, but these errors were encountered: