json_deserialization: _construct_model_reference
is called with generic model.Referable
type
#367
Labels
duplicate
This issue or pull request already exists
enhancement
Enhancement of an existing feature
sdk
Something to do with the `sdk` package
Currently,
_construct_model_reference
is very often called with the genericmodel.Referable
astype_
, instead of one of the more concret subclasses (e.g.model.Property
).This means, a
model.ModelReference
then has just the genericmodel.Referable
astype
attribute, leading to problems when trying to analyze the Reference further in the code.I suggest to improve the calls of this deserialization function so that the actual type of the model object that the
ModelReference
points to is written to theModelReference.type
.This issue was first noted in #337, where a hotfix is implemented, by inferering the type the
ModelReference
points to by using thelast_key_type
of the last Key in the ReferencesKeys
.Once this issue is solved, we should remove the then unnecessary hotfix from the
_construct_model_reference
method, that is marked with# TODO
.The text was updated successfully, but these errors were encountered: