You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the type of a ModelReference is set as Referable for many attributes. Maybe it should be determined by checking the last key instead? The last key is currently only used to validate the type of a ModelReference, but not to determine it.
The text was updated successfully, but these errors were encountered:
In JSON, the, _construct_model_reference is very often called with the generic model.Referable as type_, instead of one of the more concret subclasses (e.g. model.Property).
This means, a model.ModelReference then has just the generic model.Referable as type 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 the ModelReference.type.
This issue was first noted in #337, where a hotfix is implemented, by inferering the type the ModelReference points to by using the last_key_type of the last Key in the References Keys.
Once this issue is solved, we should remove the then unnecessary hotfix from the _construct_model_reference method, that is marked with # TODO.
Currently, the type of a
ModelReference
is set asReferable
for many attributes. Maybe it should be determined by checking the last key instead? The last key is currently only used to validate the type of aModelReference
, but not to determine it.The text was updated successfully, but these errors were encountered: