Avatar

Serialize a Geotab Object in v5.7.1804

0

 Hi,

The ignoreEmptyObjects, ignoreNulls, and prettyPrint properties is not supported any more.

GeotabJsonSerializer serializer = new GeotabJsonSerializer();
string json = serializer.ObjectToJSON(value, ignoreEmptyObjects: true, ignoreNulls: true, prettyPrint: true);  // This was possible in prior versions

How do I prettyPrint using JsonConvert.SerializeObject().  The ids are not getting printed.  Can you provide an example for Driver?

Thanks

eeidfn

 

Daniel Fenn

Please sign in to leave a comment.

1 comment

0
Avatar

Here's a workaround for 1804 nuget package to get you moving again.

class FennGeotabJsonSerializer : GeotabJsonSerializer
{
public FennGeotabJsonSerializer(IEnumerable<JsonConverter> additionalConverters, bool ignoreEmptyObjects = false, bool ignoreNulls = true, bool prettyPrint = false)
: base(additionalConverters, ignoreEmptyObjects, ignoreNulls, prettyPrint)
{
}
}

var serializer = new FennGeotabJsonSerializer(Array.Empty<JsonConverter>(), ignoreEmptyObjects: true, ignoreNulls: true, prettyPrint: true);
string json = serializer.ObjectToJSON(value);
Steve Hansen 0 votes