Skip to content

Commit c07889b

Browse files
authored
Merge pull request #946 from telefonicaid/revert-945-revert-942-task/default_attribute_value_null_instead_blank
Task/default attribute value null instead blank
2 parents 1f5b396 + cd40d08 commit c07889b

File tree

44 files changed

+185
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+185
-183
lines changed

CHANGES_NEXT_RELEASE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Use null instead of ' ' as default attribute value in entity provisioned (#938)
12
Add: defaultEntityNameConjunction config (env var IOTA_DEFAULT_ENTITY_NAME_CONJUNCTION) and configuration group API field for default entity_name conjunction (#944)
23
Add basic NGSI-LD support as experimental feature (#842)
34
- Active measures

lib/constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
const LOCATION_DEFAULT = '0, 0';
2727
const DATETIME_DEFAULT = '1970-01-01T00:00:00.000Z';
28-
const ATTRIBUTE_DEFAULT = ' ';
28+
const ATTRIBUTE_DEFAULT = null;
2929

3030
/**
3131
* Provides a default value for DateTime, GeoProperty and Property Attributes.
@@ -82,6 +82,7 @@ module.exports = {
8282
MONGO_ALARM: 'MONGO-ALARM',
8383
ORION_ALARM: 'ORION-ALARM',
8484
IOTAM_ALARM: 'IOTAM-ALARM',
85+
8586
ATTRIBUTE_DEFAULT,
8687
DATETIME_DEFAULT,
8788

test/unit/examples/contextRequests/createMinimumProvisionedDevice.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "attr_name",
1010
"type": "string",
11-
"value": " "
11+
"value": null
1212
}
1313
]
1414
}

test/unit/examples/contextRequests/createProvisionedDevice.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "attr_name",
1010
"type": "string",
11-
"value": " "
11+
"value": null
1212
},
1313
{
1414
"name": "hardcodedAttr",

test/unit/examples/contextRequests/createProvisionedDeviceMultientity.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "attr_name",
1010
"type": "string",
11-
"value": " "
11+
"value": null
1212
},
1313
{
1414
"name": "hardcodedAttr",

test/unit/examples/contextRequests/createProvisionedDeviceWithGroup.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
{
99
"name": "attr_name",
1010
"type": "string",
11-
"value": " "
11+
"value": null
1212
},
1313
{
1414
"name": "status",
1515
"type": "Boolean",
16-
"value": " "
16+
"value": null
1717
},
1818
{
1919
"name": "hardcodedAttr",

test/unit/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
{
99
"name": "attr_name",
1010
"type": "string",
11-
"value": " "
11+
"value": null
1212
},
1313
{
1414
"name": "status",
1515
"type": "Boolean",
16-
"value": " "
16+
"value": null
1717
},
1818
{
1919
"name": "hardcodedAttr",

test/unit/examples/contextRequests/createProvisionedDeviceWithGroupAndStatic2.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
{
99
"name": "attr_name",
1010
"type": "string",
11-
"value": " "
11+
"value": null
1212
},
1313
{
1414
"name": "status",
1515
"type": "Boolean",
16-
"value": " "
16+
"value": null
1717
},
1818
{
1919
"name": "hardcodedAttr",

test/unit/examples/contextRequests/createTimeinstantDevice.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "TimeInstant",
1010
"type": "ISO8601",
11-
"value": " "
11+
"value": null
1212
}
1313
]
1414
}

test/unit/examples/contextRequests/updateContext5.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
"attributes": [{
77
"name": "state",
88
"type": "Boolean",
9-
"value": " "
9+
"value": null
1010
},
1111
{
1212
"name": "dimming",
1313
"type": "Percentage",
14-
"value": " "
14+
"value": null
1515
}
1616
]
1717
}],
1818
"updateAction": "APPEND"
19-
}
19+
}

test/unit/examples/contextRequests/updateProvisionActiveAttributes1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "temperature",
1010
"type": "centigrades",
11-
"value": " "
11+
"value": null
1212
}
1313
]
1414
}

test/unit/examples/contextRequests/updateProvisionCommands1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "temperature",
1010
"type": "centigrades",
11-
"value": " "
11+
"value": null
1212
},
1313
{
1414
"name": "move_status",

test/unit/examples/contextRequests/updateProvisionDeviceStatic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "newAttribute",
1010
"type": "Integer",
11-
"value": " "
11+
"value": null
1212
},
1313
{
1414
"name": "cellID",

test/unit/examples/contextRequests/updateProvisionMinimumDevice.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "newAttribute",
1010
"type": "Integer",
11-
"value": " "
11+
"value": null
1212
}
1313
]
1414
}

test/unit/examples/contextResponses/createBidirectionalDeviceSuccess.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"name": "location",
88
"type": "geo:point",
9-
"value": " "
9+
"value": null
1010
}
1111
],
1212
"id": "TheFirstLight",

test/unit/examples/contextResponses/createTimeinstantSuccess.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"name": "TimeInstant",
88
"type": "ISO8601",
9-
"value": " "
9+
"value": null
1010
}
1111
],
1212
"id": "eii01201ttt",
@@ -19,4 +19,4 @@
1919
}
2020
}
2121
]
22-
}
22+
}

test/unit/examples/contextResponses/updateProvisionCommands1Success.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"name": "temperature",
88
"type": "centigrades",
9-
"value": " "
9+
"value": null
1010
},
1111
{
1212
"name": "move_status",

test/unit/ngsi-ld/examples/contextRequests/createMinimumProvisionedDevice.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"@context": "http://context.json-ld",
44
"attr_name": {
55
"type": "Property",
6-
"value": " "
6+
"value": null
77
},
88
"id": "urn:ngsi-ld:MicroLights:FirstMicroLight",
99
"type": "MicroLights"

test/unit/ngsi-ld/examples/contextRequests/createProvisionedDevice.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"@context": "http://context.json-ld",
44
"attr_name": {
55
"type": "Property",
6-
"value": " "
6+
"value": null
77
},
88
"commandAttr_info": {
99
"type": "Property",

test/unit/ngsi-ld/examples/contextRequests/createProvisionedDeviceMultientity.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"@context": "http://context.json-ld",
44
"attr_name": {
55
"type": "Property",
6-
"value": " "
6+
"value": null
77
},
88
"commandAttr_info": {
99
"type": "Property",
Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
[
2-
{
3-
"@context": "http://context.json-ld",
4-
"attr_name": {
5-
"type": "Property",
6-
"value": " "
7-
},
8-
"bootstrapServer": {
9-
"type": "Property",
10-
"value": {
11-
"@type": "Address",
12-
"@value": "127.0.0.1"
13-
}
14-
},
15-
"commandAttr_info": {
16-
"type": "Property",
17-
"value": {
18-
"@type": "commandResult",
19-
"@value": " "
20-
}
21-
},
22-
"commandAttr_status": {
23-
"type": "Property",
24-
"value": {
25-
"@type": "commandStatus",
26-
"@value": "UNKNOWN"
27-
}
28-
},
29-
"hardcodedAttr": {
30-
"type": "Property",
31-
"value": {
32-
"@type": "hardcodedType",
33-
"@value": "hardcodedValue"
34-
}
35-
},
36-
"id": "urn:ngsi-ld:TheLightType:TheFirstLight",
37-
"status": {
38-
"type": "Property",
39-
"value": true
40-
},
41-
"type": "TheLightType",
42-
"wheel1_info": {
43-
"type": "Property",
44-
"value": {
45-
"@type": "commandResult",
46-
"@value": " "
47-
}
48-
},
49-
"wheel1_status": {
50-
"type": "Property",
51-
"value": {
52-
"@type": "commandStatus",
53-
"@value": "UNKNOWN"
54-
}
55-
}
2+
{
3+
"@context": "http://context.json-ld",
4+
"id": "urn:ngsi-ld:TheLightType:TheFirstLight",
5+
"type": "TheLightType",
6+
"attr_name": {
7+
"type": "Property",
8+
"value": null
9+
},
10+
"status": {
11+
"type": "Property",
12+
"value": false
13+
},
14+
"hardcodedAttr": {
15+
"type": "Property",
16+
"value": {
17+
"@type": "hardcodedType",
18+
"@value": "hardcodedValue"
19+
}
20+
},
21+
"bootstrapServer": {
22+
"type": "Property",
23+
"value": {
24+
"@type": "Address",
25+
"@value": "127.0.0.1"
26+
}
27+
},
28+
"commandAttr_status": {
29+
"type": "Property",
30+
"value": {
31+
"@type": "commandStatus",
32+
"@value": "UNKNOWN"
33+
}
34+
},
35+
"commandAttr_info": {
36+
"type": "Property",
37+
"value": {
38+
"@type": "commandResult",
39+
"@value": " "
40+
}
41+
},
42+
"wheel1_status": {
43+
"type": "Property",
44+
"value": {
45+
"@type": "commandStatus",
46+
"@value": "UNKNOWN"
47+
}
48+
},
49+
"wheel1_info": {
50+
"type": "Property",
51+
"value": {
52+
"@type": "commandResult",
53+
"@value": " "
54+
}
5655
}
56+
}
5757
]

0 commit comments

Comments
 (0)