Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstd: add json parsing option to skip unknown fields #5852
Conversation
5e87466
to
404bbd3
|
Why is this |
You need to verify that the json is well formed as you ignore things: you need to track if you are expecting a brace vs square brackets, and in which order e.g.
ah ha! I didn't know about this field.
That's a limitation I didn't know about either; seems to be undocumented outside of the code. |
Trying to rewrite this PR, the detection for this in StreamingParser doesn't seem to work correctly? test "mismatched close" {
var p = TokenStream.init("[102, 111, 111}");
checkNext(&p, .ArrayBegin);
checkNext(&p, .Number);
checkNext(&p, .Number);
checkNext(&p, .Number);
testing.expectError(error.UnexpectedClosingBracket, p.next());
}I get:
|
|
converted to draft while I refactor to try to do #5959 at the same time. |
daurnimator commentedJul 12, 2020
Requested by @Sobeston.
I had to have the user pass in a buffer via
ParseOptionsto use for tracking the ignored state