Description:
When a property of an object has been converted from a system type (e.g. System.String) to an IObject, when deserialising from an old version, the property in question (if the old property is not null) deserialises as null, which is a valid value for an IObject, so deserialisation carries on as normal.
There is no check that the original value was not null. This leads to data loss as the deserialiser doesn't have mismatches on property types, so the upgrader for the object is not run, which means that explicit versioning upgrades are not applied unless there is some other issue with the object.
Steps to reproduce:
clone the LadybugTools_Toolkit repository, checkout LadybugTools_Toolkit-#296-SeparateSimulationFromPlotting and build, then clone Versioning_Toolkit, checkout the same named branch there and build. Then open the provided grasshopper script.
The FromJson method should return a SimulationResult, but the EpwFile FileSettings property will be missing FileName and Directory information.
Expected behaviour:
FileName and Directory should be set.
Test file(s):
Unzip this and make sure that both the json and gh files are in the same folder, then run the gh script:
serialiser.zip
@IsakNaslundBh
Description:
When a property of an object has been converted from a system type (e.g.
System.String) to anIObject, when deserialising from an old version, the property in question (if the old property is not null) deserialises as null, which is a valid value for anIObject, so deserialisation carries on as normal.There is no check that the original value was not null. This leads to data loss as the deserialiser doesn't have mismatches on property types, so the upgrader for the object is not run, which means that explicit versioning upgrades are not applied unless there is some other issue with the object.
Steps to reproduce:
clone the LadybugTools_Toolkit repository, checkout
LadybugTools_Toolkit-#296-SeparateSimulationFromPlottingand build, then clone Versioning_Toolkit, checkout the same named branch there and build. Then open the provided grasshopper script.The
FromJsonmethod should return aSimulationResult, but theEpwFileFileSettingsproperty will be missingFileNameandDirectoryinformation.Expected behaviour:
FileNameandDirectoryshould be set.Test file(s):
Unzip this and make sure that both the json and gh files are in the same folder, then run the gh script:
serialiser.zip
@IsakNaslundBh