diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs index ae778bb207..5e72cb6b2f 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs @@ -4,6 +4,8 @@ using System.Globalization; using System.Linq; using System.Xml.Linq; using System.Xml.XPath; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using Umbraco.Core.Dynamics; using Umbraco.Core.PropertyEditors; @@ -186,6 +188,20 @@ namespace Umbraco.Core.Models.PublishedContent if (bool.TryParse(stringSource, out b)) return b; + //try json - expensive + if (stringSource.DetectIsJson()) + { + try + { + var obj = JsonConvert.DeserializeObject(stringSource); + return obj; + } + catch + { + //swallow, continue trying other things + } + } + // try xml - that is expensive, performance-wise XElement elt; if (XmlHelper.TryCreateXElementFromPropertyValue(stringSource, out elt))