From 3d87c5e85126385f021bf656d916c8c31ebe1c25 Mon Sep 17 00:00:00 2001 From: Keshav-NEC Date: Thu, 1 Feb 2024 09:01:21 +0000 Subject: [PATCH] default attribute type changed to Text --- CHANGES_NEXT_RELEASE | 2 +- lib/constants.js | 2 +- .../ngsiv2/contextRequests/pollingMeasure.json | 2 +- .../contextRequests/timeInstantMeasures.json | 2 +- test/unit/ngsiv2/explicit_attributes-test.js | 14 +++++++------- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 8b137891..d44c2c59 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ - +- Fix: default attribute type changed from 'string' to 'Text' (#664) diff --git a/lib/constants.js b/lib/constants.js index 8b447ba5..d299b870 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -37,7 +37,7 @@ module.exports = { HTTP_MEASURE_PATH: '/iot/d', - DEFAULT_ATTRIBUTE_TYPE: 'string', + DEFAULT_ATTRIBUTE_TYPE: 'Text', COMMAND_STATUS_PENDING: 'PENDING', COMMAND_STATUS_ERROR: 'ERROR', diff --git a/test/unit/ngsiv2/contextRequests/pollingMeasure.json b/test/unit/ngsiv2/contextRequests/pollingMeasure.json index ea515da7..b76d8521 100644 --- a/test/unit/ngsiv2/contextRequests/pollingMeasure.json +++ b/test/unit/ngsiv2/contextRequests/pollingMeasure.json @@ -2,7 +2,7 @@ "id":"Second MQTT Device", "type":"AnMQTTDevice", "a": { - "type": "string", + "type": "Text", "value": 23 } } diff --git a/test/unit/ngsiv2/contextRequests/timeInstantMeasures.json b/test/unit/ngsiv2/contextRequests/timeInstantMeasures.json index c9b292b3..a456222f 100644 --- a/test/unit/ngsiv2/contextRequests/timeInstantMeasures.json +++ b/test/unit/ngsiv2/contextRequests/timeInstantMeasures.json @@ -6,7 +6,7 @@ "value": 24.4 }, "humidity": { - "type": "string", + "type": "Text", "value": 32 }, "TimeInstant": { diff --git a/test/unit/ngsiv2/explicit_attributes-test.js b/test/unit/ngsiv2/explicit_attributes-test.js index ff5a1736..3b98fa1f 100644 --- a/test/unit/ngsiv2/explicit_attributes-test.js +++ b/test/unit/ngsiv2/explicit_attributes-test.js @@ -234,7 +234,7 @@ describe('explicitAttrs tests ', function () { .post('/v2/entities?options=upsert', { id: 'Sensor:Temperature:JSON_UNPROVISIONED', type: 'Sensor:Temperature', - h: { type: 'string', value: 33 }, + h: { type: 'Text', value: 33 }, temperature: { type: 'Number', value: 89 } }) .reply(204); @@ -414,7 +414,7 @@ describe('explicitAttrs tests ', function () { .post('/v2/entities?options=upsert', { id: 'Sensor:Temperature:JSON_UNPROVISIONED', type: 'Sensor:Temperature', - h: { type: 'string', value: 33 }, + h: { type: 'Text', value: 33 }, temperature: { type: 'Number', value: 89 } }) .reply(204); @@ -482,7 +482,7 @@ describe('explicitAttrs tests ', function () { .post('/v2/entities?options=upsert', { id: 'Sensor:Temperature:JSON_UNPROVISIONED', type: 'Sensor:Temperature', - h: { type: 'string', value: 33 }, + h: { type: 'Text', value: 33 }, temperature: { type: 'Number', value: 89 } }) .reply(204); @@ -620,7 +620,7 @@ describe('explicitAttrs tests ', function () { .post('/v2/entities?options=upsert', { id: 'Sensor:Temperature:JSON_UNPROVISIONED', type: 'Sensor:Temperature', - h: { type: 'string', value: 33 }, + h: { type: 'Text', value: 33 }, temperature: { type: 'Number', value: 89 } }) .reply(204); @@ -663,7 +663,7 @@ describe('explicitAttrs tests ', function () { .post('/v2/entities?options=upsert', { id: 'Sensor:Temperature:JSON_UNPROVISIONED', type: 'Sensor:Temperature', - h: { type: 'string', value: 33 }, + h: { type: 'Text', value: 33 }, temperature: { type: 'Number', value: 89 } }) .reply(204); @@ -731,7 +731,7 @@ describe('explicitAttrs tests ', function () { .post('/v2/entities?options=upsert', { id: 'Sensor:Temperature:JSON_UNPROVISIONED', type: 'Sensor:Temperature', - h: { type: 'string', value: 33 }, + h: { type: 'Text', value: 33 }, temperature: { type: 'Number', value: 89 } }) .reply(204); @@ -869,7 +869,7 @@ describe('explicitAttrs tests ', function () { .post('/v2/entities?options=upsert', { id: 'Sensor:Temperature:JSON_UNPROVISIONED', type: 'Sensor:Temperature', - h: { type: 'string', value: 33 }, + h: { type: 'Text', value: 33 }, temperature: { type: 'Number', value: 89 } }) .reply(204);