diff --git a/MetasysServices/Models/MetasysObject.cs b/MetasysServices/Models/MetasysObject.cs index 6f1838b..5cd41ee 100644 --- a/MetasysServices/Models/MetasysObject.cs +++ b/MetasysServices/Models/MetasysObject.cs @@ -82,6 +82,7 @@ public MetasysObject() { } /// Classification of the object /// public string Classification { get; set; } + private const string DefaultClassification = "object"; internal MetasysObject(JToken token, ApiVersion version, IEnumerable children = null, MetasysObjectTypeEnum? type =null) { @@ -187,11 +188,19 @@ internal MetasysObject(JToken token, ApiVersion version, IEnumerable() : null; + if (jobj.ContainsKey("classification")) + { + var tokenValue = token["classification"].Value().Trim(); + Classification = tokenValue == string.Empty ? DefaultClassification : tokenValue; + } + else + { + Classification = DefaultClassification; + } } catch { - Classification = null; + Classification = DefaultClassification; } }