Add Merge-Patch Support Handling#1283
Conversation
|
When in For example, a payload like this {
"position": [
{
"type": "Property",
"value": [ 1, 2, 3 ],
"datasetId": "urn:ngsi-ld:this"
},
{
"type": "Property",
"value": [ 28, -104, 23 ],
"datasetId": "urn:ngsi-ld:that"
}
]
} Will send two copies of the Without further changes downstream, at the moment, the IoT Agent for JSON and IoT Agent for Ultralight will accept this as two sequential commands on the default |
Update expectation since merge-patch needs to retrieve lazy attributes as well.
|
This PR will close the remaining issues from #1259
|
| | IOTA_LD_SUPPORT_NULL | `server.ldSupport.null` | | ||
| | IOTA_LD_SUPPORT_DATASET_ID | `server.ldSupport.datasetId` | |
There was a problem hiding this comment.
Those parameters need to be documented
| deviceObj.type = deviceData.type; | ||
| deviceObj.staticAttributes = deviceData.staticAttributes; | ||
| deviceObj.commands = deviceData.commands; | ||
| deviceObj.lazy = deviceData.lazy; |
There was a problem hiding this comment.
Could you explain why you included this line and how it is related with functionalities implemented in this PR (merge patch)
There was a problem hiding this comment.
This is necessary to ensure that a lazy attribute may be merged-patched (see use on line lib/services/northBound/contextServer-NGSI-LD.js - 455)
|
CHANGES_NEXT_RELEASE entry is missing |
Fixed ce7746b |
|
@jason-fox please fix the small conflict in CHANGES_NEXT_RELEASE file so this PR becomes mergeable again. |
|
@jason-fox weirdly, test are failing |
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
@mapedraza this is because this PR predates #1302 which has just been merged, and therefore the updated 1.6.1 NGSI-LD registration is required when provisioning - fixed 8510ad2 |
merge-patch is an advanced operation which would be usefully supported by some robotics IoT Agents - e.g. ROS2, OPC-UA. This PR adds a new merge-patch handler and forwards NGSI-LD merge-patch requests to the handler as necessary.
Not all IoT Agents will need to support advanced services such as merge-patch, NGSI-LD null or datasetId, flags have been included to allow support for these payloads to be withdrawn.