This PR fixes the response schema for the GET {scopeId}/data/messages/{datastoreMessageId} endpoint in the Kapua API. Previously, the OpenAPI schema incorrectly documented the response as dataMessageListResult when it should have returned a dataMessage.
What was fixed
The OpenAPI documentation previously showed the following response:
Summary
This PR fixes the response schema for the
GET {scopeId}/data/messages/{datastoreMessageId}
endpoint in the Kapua API. Previously, the OpenAPI schema incorrectly documented the response asdataMessageListResult
when it should have returned adataMessage
.What was fixed
The OpenAPI documentation previously showed the following response:
Old example
```json { "type": "storableListResult", "limitExceeded": true, "size": 2, "items": [ { "type": "jsonDatastoreMessage", "capturedOn": "2019-09-12T09:35:04.383Z", "channel": { "type": "kapuaDataChannel", "semanticParts": [ "heater", "data" ] }, "clientId": "Client-Id-1", "deviceId": "WyczTs_GuDM", "payload": { "metrics": [ { "valueType": "string", "value": 5, "name": "temperatureExternal" }, { "valueType": "string", "value": 20.25, "name": "temperatureInternal" }, { "valueType": "string", "value": 30, "name": "temperatureExhaust" }, { "valueType": "string", "value": -441478528, "name": "errorCode" } ] }, "receivedOn": "2019-09-12T09:35:04.389Z", "scopeId": "AQ", "sentOn": "2019-09-12T09:35:04.383Z", "datastoreId": "6349cec8-396b-4aac-bc2f-8fca9fe0c67c", "timestamp": "2019-09-12T09:35:04.383Z" }, { "type": "jsonDatastoreMessage", "capturedOn": "2019-09-12T09:25:05.096Z", "channel": { "type": "kapuaDataChannel", "semanticParts": [ "heater", "data" ] }, "clientId": "Client-Id-1", "deviceId": "WyczTs_GuDM", "payload": { "metrics": [ { "valueType": "string", "value": 5, "name": "temperatureExternal" }, { "valueType": "string", "value": 20, "name": "temperatureInternal" }, { "valueType": "string", "value": 30, "name": "temperatureExhaust" }, { "valueType": "string", "value": 0, "name": "errorCode" } ] }, "receivedOn": "2019-09-12T09:25:05.102Z", "scopeId": "AQ", "sentOn": "2019-09-12T09:25:05.096Z", "datastoreId": "bb07d7fc-dc62-492f-b8da-7e28df69e112", "timestamp": "2019-09-12T09:25:05.096Z" } ], "totalCount": 61 } ```However, the correct response format should be a
dataMessage
, as seen here:New example
```json { "type": "jsonDatastoreMessage", "capturedOn": "2019-09-12T09:25:05.096Z", "channel": { "type": "kapuaDataChannel", "semanticParts": [ "heater", "data" ] }, "clientId": "Client-Id-1", "deviceId": "WyczTs_GuDM", "payload": { "metrics": [ { "valueType": "string", "value": 5, "name": "temperatureExternal" }, { "valueType": "string", "value": 20, "name": "temperatureInternal" }, { "valueType": "string", "value": 30, "name": "temperatureExhaust" }, { "valueType": "string", "value": 0, "name": "errorCode" } ] }, "receivedOn": "2019-09-12T09:25:05.102Z", "scopeId": "AQ", "sentOn": "2019-09-12T09:25:05.096Z", "datastoreId": "bb07d7fc-dc62-492f-b8da-7e28df69e112", "timestamp": "2019-09-12T09:25:05.096Z" } ```A real response example:
Real response example
```json { "type": "jsonDatastoreMessage", "channel": { "semanticParts": [ "genericMetric" ] }, "clientId": "pahoClient", "deviceId": "T5mpNWpOcdY", "payload": { "metrics": [ { "valueType": "string", "value": "GeneriMetricHere", "name": "genericMetric" } ] }, "receivedOn": "1970-01-20T23:56:28.576Z", "scopeId": "AQ", "datastoreId": "9f55aa27-e3c4-4709-8bee-091466d04f18", "timestamp": "2024-10-01T13:16:16.611Z" } ```