Closed Timboooh closed 1 year ago
It does look like you're using this correctly. @pboyd04 any ideas?
I'm not sure if it ever worked, because I can't find any parsing code for the [parent.child].
In redpath.c:165
the propname just gets set to index. (Status.Health in my example) with the REDPATH_OP_EXISTS
operation.
Then later, when this operation gets executed in payload.c
this same path string gets used (as nodeName) when jansson is called: value = json_object_get(payload->json, nodeName)
Only this function doesn't support json paths, only json keys.
I have two ideas on how I might be able to fix this:
json_object_get_by_path
function and use it in payload.c
which would be able to handle these json paths.redpath.c
split this [parent.child] into two seperate redpathnodes that get handled separately.IMHO option 1 is way simpler, and I already have working code that can handle json paths. I think I can implement it in payload.c
, without breaking any current functionality. But I would have to test this first.
Let me know what you think about it.
Please see #163
Fix merged
Hey,
I'm having trouble using the library with RedPath. The
[node.child]
expression doesn't get parsed correctly.Redpath works as expected when I use
/Chassis[0]/Sensors[Status]
But when I use/Chassis[0]/Sensors[Status.Health]
nothing gets returned. I verified these do exist using the redfishcli demo from this repository.The endnode looks like this in VSCode, when debugging with GDB:
I'm developing and running this application on Linux. And I use the Redfish-Interface-Emulator to test my application. If you need any additional information to be able to help please tell me.
Thanks a lot.