mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Micro-service via JSON plugin: remove dot from the main object when loading the tree
This commit is contained in:
parent
b3945f8b0e
commit
147168fcd5
2 changed files with 8 additions and 2 deletions
|
|
@ -107,11 +107,17 @@ int load_json_plugin(struct list_head *json_plugin, struct list_head *json_list,
|
|||
|
||||
char obj_prefix[1024] = {0};
|
||||
json_plugin_find_prefix_obj(node_obj, obj_prefix, sizeof(obj_prefix));
|
||||
if (strlen(obj_prefix) == 0) {
|
||||
|
||||
int obj_prefix_len = strlen(obj_prefix);
|
||||
if (obj_prefix_len == 0) {
|
||||
ERR("ERROR: Obj prefix is empty for (%s) Object\n", node_obj);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Remove '.' from object prefix
|
||||
if (obj_prefix[obj_prefix_len - 1] == '.')
|
||||
obj_prefix[obj_prefix_len - 1] = 0;
|
||||
|
||||
DMOBJ *dm_entryobj = (DMOBJ *)dm_dynamic_calloc(json_memhead, 2, sizeof(DMOBJ));
|
||||
if (dm_entryobj == NULL) {
|
||||
ERR("ERROR: No Memory exists\n");
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ static void dm_browse_service(struct dmctx *dmctx, DMNODE *parent_node, DMOBJ *e
|
|||
|
||||
if (dmctx->checkobj) {
|
||||
*err = dmctx->checkobj(dmctx, &node, NULL, NULL, NULL, NULL, data, instance);
|
||||
if (*err && !dmctx->inparam_isparam && DM_STRSTR(dmctx->in_param, parent_obj) != dmctx->in_param)
|
||||
if (*err)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue