Replies: 2 comments
-
Thanks so much for providing a minimal example and bringing up this behavior. I plan to dig into this a bit more soon, after adding support for non-null terminated buffers (like string_views to portions of a string). This work is occurring in #1213 and addresses #1054. I think handling this longstanding limitation will help tackle this particular issue and how it should be solved. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks! Looking forward, I'm excited for this one! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The behavior of get_sv_json behaves a bit differently in some cases when retrieving the last key of a JSON blob -- the newline and spaces are attached.
If the object is inside an array like:
std::string json = R"({ "data": [ { "id": 162904329731651 }, { "id": 162904329751651 }, ] })";
We parse the
id
asid: 162904329751651N____________
(replacing \n with N and ' ' with '_' for visibility)A minimal example: godbolt
Relatedly, is there a preferred way to use get_sv_json to loop through such an array? I've been doing manual string splitting (as I expect using the array notation takes me back to the beginning each time?)
Beta Was this translation helpful? Give feedback.
All reactions