Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

PBT-823 fix deserialisation #92

Merged
merged 5 commits into from
Jun 15, 2020
Merged

PBT-823 fix deserialisation #92

merged 5 commits into from
Jun 15, 2020

Conversation

Andyck
Copy link
Collaborator

@Andyck Andyck commented Jun 12, 2020

Problem:
if you create a measurement in c8y and retrieve it from c8y again, the measurement is packed into another JsonObject and the type is changed from float to string.
So the serialized object is no longer identical to the re-serialized object:

Expected: 
{
    "CalculatedPowerValuesPerMonth": {
      "solar": {
        "value": 5730347.0,
        "unit": "Wh"
      }
    },
    "id": "1234567",
    "time": "2020-06-10T13:27:31.696+02",
    "type": "CalculatedPowerValuesPerMonth"
  }

Actual: 
{
    "CalculatedPowerValuesPerMonth": {
      "solar": {
        "value": {
          "value": "5730347.0"
        },
        "unit": "Wh"
      }
    },
    "id": "1234567",
    "time": "2020-06-10T13:27:31.696+02",
    "type": "CalculatedPowerValuesPerMonth"
  }

@Andyck Andyck merged commit 3086be0 into develop Jun 15, 2020
@Andyck Andyck deleted the PBT-823_fix-deserialisation branch June 15, 2020 12:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant