Skip to content

Commit 5c35736

Browse files
authored
Merge pull request #1479 from telefonicaid/fix/ensure_entity_id_string
apply for all id of entities (hotfix 3.4.2)
2 parents a591a37 + 948e8f7 commit 5c35736

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/services/ngsi/entities-NGSI-v2.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
343343
const payload = {
344344
entities: [
345345
{
346-
id: entityName
346+
// CB entity id should be always a String
347+
id: String(entityName)
347348
}
348349
]
349350
};
@@ -677,8 +678,9 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
677678
logger.debug(context, 'sendUpdateValueNgsi2 entityNameExp %j ', typeInformation.entityNameExp);
678679
entityName = expressionPlugin.applyExpression(typeInformation.entityNameExp, ctxt, typeInformation);
679680
// CB entity id should be always a String
680-
payload.entities[0].id = String(entityName);
681-
ctxt['entity_name'] = String(entityName);
681+
entityName = String(entityName);
682+
payload.entities[0].id = entityName;
683+
ctxt['entity_name'] = entityName;
682684
} catch (e) {
683685
logger.debug(
684686
context,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "iotagent-node-lib",
33
"license": "AGPL-3.0-only",
44
"description": "IoT Agent library to interface with NGSI Context Broker",
5-
"version": "3.4.1",
5+
"version": "3.4.2",
66
"homepage": "https://github.com/telefonicaid/iotagent-node-lib",
77
"keywords": [
88
"fiware",

0 commit comments

Comments
 (0)