Skip to content

Commit

Permalink
Merge pull request #1478 from telefonicaid/fix/ensure_entity_id_string
Browse files Browse the repository at this point in the history
ensure entity id is a string (hotfix 3.4.0)
  • Loading branch information
fgalan authored Oct 2, 2023
2 parents 906eecf + d84c69c commit a591a37
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix: ensure entity_id is a stirng when is result of entityNameExp (#1476)
5 changes: 3 additions & 2 deletions lib/services/ngsi/entities-NGSI-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,9 @@ function sendUpdateValueNgsi2(entityName, attributes, typeInformation, token, ca
try {
logger.debug(context, 'sendUpdateValueNgsi2 entityNameExp %j ', typeInformation.entityNameExp);
entityName = expressionPlugin.applyExpression(typeInformation.entityNameExp, ctxt, typeInformation);
payload.entities[0].id = entityName;
ctxt['entity_name'] = entityName;
// CB entity id should be always a String
payload.entities[0].id = String(entityName);
ctxt['entity_name'] = String(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.0",
"version": "3.4.1",
"homepage": "https://github.com/telefonicaid/iotagent-node-lib",
"keywords": [
"fiware",
Expand Down

0 comments on commit a591a37

Please sign in to comment.