Skip to content

Commit

Permalink
Merge pull request #746 from FIWARE/hardening/troe-test-post-entities
Browse files Browse the repository at this point in the history
hardening/troe-test-post-entities
  • Loading branch information
kzangeli committed Mar 6, 2021
2 parents 233795e + 86d32d6 commit f101aee
Show file tree
Hide file tree
Showing 3 changed files with 501 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/lib/orionld/troe/troeEntityArrayExpand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@ void troeEntityArrayExpand(KjNode* tree)
if (contextP == NULL)
contextP = orionldCoreContextP;

//
// FIXME: Call instead troeEntityExpand (currently in troePostEntities.cpp)
// Move the function to its own module troe/troeEntityExpand.h/cpp
//
for (KjNode* attrP = entityP->value.firstChildP; attrP != NULL; attrP = attrP->next)
{
if (strcmp(attrP->name, "type") == 0)
attrP->value.s = orionldContextItemExpand(contextP, attrP->value.s, true, NULL);
else if (strcmp(attrP->name, "id") == 0) {}
else if (strcmp(attrP->name, "location") == 0) {}
else if (strcmp(attrP->name, "observationSpace") == 0) {}
else if (strcmp(attrP->name, "operationSpace") == 0) {}
else
{
attrP->name = orionldContextItemExpand(contextP, attrP->name, true, NULL);
Expand Down
6 changes: 4 additions & 2 deletions src/lib/orionld/troe/troePostEntities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ void troeEntityExpand(KjNode* entityP)
attrP->value.s = orionldContextItemExpand(orionldState.contextP, attrP->value.s, true, NULL);
LM_TMP(("EXPAND: TO '%s' (entity type value)", attrP->value.s));
}
else if (strcmp(attrP->name, "id") == 0) {}
else if (strcmp(attrP->name, "location") == 0) {}
else if (strcmp(attrP->name, "id") == 0) {}
else if (strcmp(attrP->name, "location") == 0) {}
else if (strcmp(attrP->name, "observationSpace") == 0) {}
else if (strcmp(attrP->name, "operationSpace") == 0) {}
else
{
attrP->name = orionldContextItemExpand(orionldState.contextP, attrP->name, true, NULL);
Expand Down
Loading

0 comments on commit f101aee

Please sign in to comment.