kuiperfoliage

Bug: Serialization of Attribute values

Discussion created by kuiperfoliage on Jan 9, 2014
Latest reply on Oct 15, 2014 by mnielsen-esristaff
Hi,

I found a bug in ArcGIS Runtime for WPF version: 10.1.1.0 when using ToJson() to serialize a GraphicsLayer. It seems that attribute values are not serialized correctly as they lose their original datatype and are converted into strings.

the error is in the following line
                        jw.WriteProperty(pair.Key, (pair.Value != null) ? string.Format(CultureInfo.InvariantCulture, "{0}", new object[] { pair.Value }) : null);

within
        public static void WriteAttributes(ArcGISJsonWriter jw, IDictionary<string, object> attributes, bool onlyDirty, Dictionary<string, object> dirtyList, List<string> fields, string objectIdField)

Because of the string.format() call the value of the attribute, whether it is a boolean, double or string, is converted into a string and then stored as
key: "value"

in the json, instead of (with a double)
key: value

This bug is pretty inconvenient for us as it affects our application and thus our users.

Is this fixed in the latest release of ArcGIS Runtime ? Sadly enough we can't yet upgrade to VS2012 or VS2013 and are still using VS2010.

Can you confirm the bug and perhaps give advise on how to proceed to get this fixed for our installation that would work on VS2010.

Thanks!

Outcomes