refactoring and GetAssertion works

This commit is contained in:
merlokk 2018-11-27 13:45:29 +02:00
commit 317ea30529
4 changed files with 34 additions and 11 deletions

View file

@ -455,7 +455,12 @@ CborError CborGetStringValueBuf(CborValue *elm) {
};
int CBOREncodeElm(json_t *root, char *rootElmId, CborEncoder *encoder) {
json_t *elm = json_object_get(root, rootElmId);
json_t *elm = NULL;
if (rootElmId && strlen(rootElmId) && rootElmId[0] == '$')
elm = json_path_get(root, rootElmId);
else
elm = json_object_get(root, rootElmId);
if (!elm)
return 1;