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
json_object_object_get_ex returning the original object #532
Comments
I don't understand your question well. In case of short messages, the short string will be stored in char array[32], For the larger message(long string/Nested object), the json-object will store the address (*ptr/*c_object ) of string/nested object. |
Look carefully at your original "CONFIG" message. Printing it out with indenting helps: {
"type": "CONFIG",
"ip": "10.0.0.42",
"data": {
"ip": "10.0.0.42",
"type": "CONFIG",
"data": {
"manufacturer": "atecom GmbH",
"model": "Eagle",
"serial-no": "253.00.01.0001.0002.592BDE31",
"hardware-version": "1.1",
"firmware-version": "1.3",
"hostname": "Eagle1",
"services": [
{
"name": "gbe2",
... it is the original message that is double-nested, |
Dear Pierce, |
you wrote |
@sohail-shareef, this is not a message forum, please don't hijack issues (especially other people's), and instead ask your questions at https://groups.google.com/g/json-c |
I'm using json-c to parse messages provided by a device driver.
It works perfect within most of all cases (thanks, great job), but I'm facing an issue, in case larger JSON messages are parsed:
The parser correctly parses the message (see Message).
Afterwards I'm extracting the "data" object and passing it to a
handler. In case of short messages, everything works as expected.
For the larger message, the handler gets the original message object instead of "data". Extracting "data" a 2nd time solves the problem, but that's, I think, not the proper way.
The text was updated successfully, but these errors were encountered: