We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug description
NGSI patch is not properly working when apply to "id" or "type" macro substitution from a number value.
How to reproduce it Steps to reproduce the behavior (as an example)
curl --location 'http://host:1026/v2/subscriptions' \ --header 'Fiware-Service: service' \ --header 'Fiware-ServicePath: /servicepath' \ --header 'X-Auth-Token: gA...' \ --header 'Content-Type: application/json' \ --data '{ "description": "ngsi patch id and type", "status": "active", "subject": { "entities": [ { "idPattern": ".*", "type": "ExampleType" } ], "condition": { "attrs": [ "TimeInstant" ], "alterationTypes": [ "entityUpdate", "entityCreate", "entityDelete" ] } }, "notification": { "attrs": [ "externalId", "TimeInstant" ], "onlyChangedAttrs": false, "attrsFormat": "normalized", "httpCustom": { "url": "https://host", "ngsi": { "id": "${externalId}", "type": "${externalId}" } } } }'
curl -iX POST 'http://localhost:1026/v2/entities' \ -H 'Content-Type: application/json' \ -d ' { "id": "exampleId2", "type": "ExampleType", "TimeInstant": { "type": "DateTime", "value": "2023-07-01T09:06:15.000Z", "metadata": {} }, "externalId": { "type": "Number", "value": 12, "metadata": {} } }'
The payload of the notification is:
{ "subscriptionId": "6584....", "data": [ { "id": "", "type": "Thing", "externalId": { "type": "Number", "value": 12, "metadata": {} }, "TimeInstant": { "type": "DateTime", "value": "2023-07-01T09:07:15.000Z", "metadata": {} } } ] }
Notice: the "id" value is an empty string and the "type": "Thing".
Expected behavior A solution for this macro replacement would be to "stringify" the number to be applied to the id's and type's value.
Additional information
Additionaly, I have tried with a externalId's value as 102 and the behaviour is different getting a notification as:
102
{ "subscriptionId": "6584...", "data": [ { "id": "0", "type": "0", "externalId": { "type": "Number", "value": 102, "metadata": {} }, "TimeInstant": { "type": "DateTime", "value": "2023-07-01T09:08:15.000Z", "metadata": {} } } ] }
Where "id" neither "type" are properly parsed or "stringified".
The text was updated successfully, but these errors were encountered:
PR #4468
Sorry, something went wrong.
Tested and working. Thanks.
No branches or pull requests
Bug description
NGSI patch is not properly working when apply to "id" or "type" macro substitution from a number value.
How to reproduce it
Steps to reproduce the behavior (as an example)
The payload of the notification is:
Notice: the "id" value is an empty string and the "type": "Thing".
Expected behavior
A solution for this macro replacement would be to "stringify" the number to be applied to the id's and type's value.
Additional information
Additionaly, I have tried with a externalId's value as
102
and the behaviour is different getting a notification as:Where "id" neither "type" are properly parsed or "stringified".
The text was updated successfully, but these errors were encountered: