Skip to content

Commit

Permalink
Merge pull request #1479 from telefonicaid/fix/ensure_entity_id_string
Browse files Browse the repository at this point in the history
apply for all id of entities (hotfix 3.4.2)
  • Loading branch information
fgalan authored Oct 2, 2023
2 parents a591a37 + 948e8f7 commit 5c35736
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/services/ngsi/entities-NGSI-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
const payload = {
entities: [
{
id: entityName
// CB entity id should be always a String
id: String(entityName)
}
]
};
Expand Down Expand Up @@ -677,8 +678,9 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
logger.debug(context, 'sendUpdateValueNgsi2 entityNameExp %j ', typeInformation.entityNameExp);
entityName = expressionPlugin.applyExpression(typeInformation.entityNameExp, ctxt, typeInformation);
// CB entity id should be always a String
payload.entities[0].id = String(entityName);
ctxt['entity_name'] = String(entityName);
entityName = String(entityName);
payload.entities[0].id = entityName;
ctxt['entity_name'] = entityName;
} catch (e) {
logger.debug(
context,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "iotagent-node-lib",
"license": "AGPL-3.0-only",
"description": "IoT Agent library to interface with NGSI Context Broker",
"version": "3.4.1",
"version": "3.4.2",
"homepage": "https://github.com/telefonicaid/iotagent-node-lib",
"keywords": [
"fiware",
Expand Down

0 comments on commit 5c35736

Please sign in to comment.