diff --git a/Src/Newtonsoft.Json.Tests/Converters/DataTableConverterTests.cs b/Src/Newtonsoft.Json.Tests/Converters/DataTableConverterTests.cs index 5a989274..89074bad 100644 --- a/Src/Newtonsoft.Json.Tests/Converters/DataTableConverterTests.cs +++ b/Src/Newtonsoft.Json.Tests/Converters/DataTableConverterTests.cs @@ -42,7 +42,6 @@ using System.Data; using System.Data.SqlTypes; using System.Linq; using Newtonsoft.Json.Tests.TestObjects; -using System.Linq; #if !(NET20 || NET35) using System.Numerics; #endif diff --git a/Src/Newtonsoft.Json/JsonSerializer.cs b/Src/Newtonsoft.Json/JsonSerializer.cs index 54cf5ebb..45925c45 100644 --- a/Src/Newtonsoft.Json/JsonSerializer.cs +++ b/Src/Newtonsoft.Json/JsonSerializer.cs @@ -174,6 +174,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how type name writing and reading is handled by the serializer. + /// The default value is . /// /// /// should be used with caution when your application deserializes JSON from an external source. @@ -196,6 +197,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how a type name assembly is written and resolved by the serializer. + /// The default value is . /// /// The type name assembly format. [Obsolete("TypeNameAssemblyFormat is obsolete. Use TypeNameAssemblyFormatHandling instead.")] @@ -215,6 +217,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how a type name assembly is written and resolved by the serializer. + /// The default value is . /// /// The type name assembly format. public virtual TypeNameAssemblyFormatHandling TypeNameAssemblyFormatHandling @@ -233,6 +236,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how object references are preserved by the serializer. + /// The default value is . /// public virtual PreserveReferencesHandling PreserveReferencesHandling { @@ -250,6 +254,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how reference loops (e.g. a class referencing itself) is handled. + /// The default value is . /// public virtual ReferenceLoopHandling ReferenceLoopHandling { @@ -267,6 +272,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. + /// The default value is . /// public virtual MissingMemberHandling MissingMemberHandling { @@ -284,6 +290,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how null values are handled during serialization and deserialization. + /// The default value is . /// public virtual NullValueHandling NullValueHandling { @@ -301,6 +308,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how default values are handled during serialization and deserialization. + /// The default value is . /// public virtual DefaultValueHandling DefaultValueHandling { @@ -318,6 +326,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how objects are created during deserialization. + /// The default value is . /// /// The object creation handling. public virtual ObjectCreationHandling ObjectCreationHandling @@ -336,6 +345,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how constructors are used during deserialization. + /// The default value is . /// /// The constructor handling. public virtual ConstructorHandling ConstructorHandling @@ -354,6 +364,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how metadata properties are used during deserialization. + /// The default value is . /// /// The metadata properties handling. public virtual MetadataPropertyHandling MetadataPropertyHandling @@ -409,6 +420,7 @@ namespace Newtonsoft.Json /// /// Indicates how JSON text output is formatted. + /// The default value is . /// public virtual Formatting Formatting { @@ -418,6 +430,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how dates are written to JSON text. + /// The default value is . /// public virtual DateFormatHandling DateFormatHandling { @@ -427,6 +440,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how time zones are handled during serialization and deserialization. + /// The default value is . /// public virtual DateTimeZoneHandling DateTimeZoneHandling { @@ -436,6 +450,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + /// The default value is . /// public virtual DateParseHandling DateParseHandling { @@ -445,6 +460,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + /// The default value is . /// public virtual FloatParseHandling FloatParseHandling { @@ -456,6 +472,7 @@ namespace Newtonsoft.Json /// Gets or sets how special floating point numbers, e.g. , /// and , /// are written as JSON text. + /// The default value is . /// public virtual FloatFormatHandling FloatFormatHandling { @@ -465,6 +482,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how strings are escaped when writing JSON text. + /// The default value is . /// public virtual StringEscapeHandling StringEscapeHandling { @@ -475,6 +493,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how and values are formatted when writing JSON text, /// and the expected date format when reading JSON text. + /// The default value is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK". /// public virtual string DateFormatString { @@ -487,7 +506,8 @@ namespace Newtonsoft.Json } /// - /// Gets or sets the culture used when reading JSON. Defaults to . + /// Gets or sets the culture used when reading JSON. + /// The default value is . /// public virtual CultureInfo Culture { @@ -497,6 +517,8 @@ namespace Newtonsoft.Json /// /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + /// A null value means there is no maximum. + /// The default value is null. /// public virtual int? MaxDepth { @@ -515,6 +537,7 @@ namespace Newtonsoft.Json /// /// Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. + /// The default value is false. /// /// /// true if there will be a check for additional JSON content after deserializing an object; otherwise, false. diff --git a/Src/Newtonsoft.Json/JsonSerializerSettings.cs b/Src/Newtonsoft.Json/JsonSerializerSettings.cs index cb03b914..482cf7ce 100644 --- a/Src/Newtonsoft.Json/JsonSerializerSettings.cs +++ b/Src/Newtonsoft.Json/JsonSerializerSettings.cs @@ -88,7 +88,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how reference loops (e.g. a class referencing itself) are handled. - /// By default errors if a reference loop is encountered. + /// The default value is . /// /// Reference loop handling. public ReferenceLoopHandling ReferenceLoopHandling @@ -99,7 +99,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - /// By default ignores missing members. + /// The default value is . /// /// Missing member handling. public MissingMemberHandling MissingMemberHandling @@ -110,7 +110,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how objects are created during deserialization. - /// By default attempts to set JSON values onto existing objects and add JSON values to existing collections during deserialization. + /// The default value is . /// /// The object creation handling. public ObjectCreationHandling ObjectCreationHandling @@ -121,7 +121,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how null values are handled during serialization and deserialization. - /// By default writes null values to JSON when serializing and sets null values to fields/properties when deserializing. + /// The default value is . /// /// Null value handling. public NullValueHandling NullValueHandling @@ -132,8 +132,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how default values are handled during serialization and deserialization. - /// By default writes a field/property value to JSON when serializing if the value is the same as the field/property's default value. - /// The deserializer will continue setting a field/property if the JSON value is the same as the default value. + /// The default value is . /// /// The default value handling. public DefaultValueHandling DefaultValueHandling @@ -150,7 +149,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how object references are preserved by the serializer. - /// By default does not preserves references when serializing types. + /// The default value is . /// /// The preserve references handling. public PreserveReferencesHandling PreserveReferencesHandling @@ -161,12 +160,12 @@ namespace Newtonsoft.Json /// /// Gets or sets how type name writing and reading is handled by the serializer. - /// By default does not read or write type names during deserialization. + /// The default value is . /// /// /// should be used with caution when your application deserializes JSON from an external source. /// Incoming types should be validated with a custom - /// when deserializing with a value other than . + /// when deserializing with a value other than . /// /// The type name handling. public TypeNameHandling TypeNameHandling @@ -177,7 +176,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how metadata properties are used during deserialization. - /// By default reads the metadata properties located at the start of a JSON object. + /// The default value is . /// /// The metadata properties handling. public MetadataPropertyHandling MetadataPropertyHandling @@ -188,7 +187,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how a type name assembly is written and resolved by the serializer. - /// By default writes the partial assembly name with the type. + /// The default value is . /// /// The type name assembly format. [Obsolete("TypeNameAssemblyFormat is obsolete. Use TypeNameAssemblyFormatHandling instead.")] @@ -200,7 +199,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how a type name assembly is written and resolved by the serializer. - /// By default the assembly used during deserialization need not match exactly the assembly used during serialization. + /// The default value is . /// /// The type name assembly format. public TypeNameAssemblyFormatHandling TypeNameAssemblyFormatHandling @@ -211,11 +210,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how constructors are used during deserialization. - /// By default first looks for a constructor marked with the JsonConstructorAttribute, then look for a public default constructor - /// (a constructor that doesn't take any arguments), then check if the class has a single public constructor with arguments - /// and finally check for a non-public default constructor. - /// If the class has multiple public constructors with arguments an error will be thrown. - /// This can be fixed by marking one of the constructors with the JsonConstructorAttribute. + /// The default value is . /// /// The constructor handling. public ConstructorHandling ConstructorHandling @@ -318,7 +313,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how and values are formatted when writing JSON text, /// and the expected date format when reading JSON text. - /// By default uses the format "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK" + /// The default value is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK". /// public string DateFormatString { @@ -332,6 +327,8 @@ namespace Newtonsoft.Json /// /// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + /// A null value means there is no maximum. + /// The default value is null. /// public int? MaxDepth { @@ -350,7 +347,7 @@ namespace Newtonsoft.Json /// /// Indicates how JSON text output is formatted. - /// By default no special formatting is applied. + /// The default value is . /// public Formatting Formatting { @@ -360,7 +357,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how dates are written to JSON text. - /// By default writes dates in ISO 8601 format. + /// The default value is . /// public DateFormatHandling DateFormatHandling { @@ -370,7 +367,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how time zones are handled during serialization and deserialization. - /// By default time zone information is preserved when converting. + /// The default value is . /// public DateTimeZoneHandling DateTimeZoneHandling { @@ -379,8 +376,8 @@ namespace Newtonsoft.Json } /// - /// Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - /// By default dates are parsed to + /// Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + /// The default value is . /// public DateParseHandling DateParseHandling { @@ -392,7 +389,7 @@ namespace Newtonsoft.Json /// Gets or sets how special floating point numbers, e.g. , /// and , /// are written as JSON. - /// By default writes special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". + /// The default value is . /// public FloatFormatHandling FloatFormatHandling { @@ -402,7 +399,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - /// By default floating point numbers are parsed to . + /// The default value is . /// public FloatParseHandling FloatParseHandling { @@ -412,7 +409,7 @@ namespace Newtonsoft.Json /// /// Gets or sets how strings are escaped when writing JSON text. - /// By default only control characters (e.g. newline) are escaped. + /// The default value is . /// public StringEscapeHandling StringEscapeHandling { @@ -421,7 +418,8 @@ namespace Newtonsoft.Json } /// - /// Gets or sets the culture used when reading JSON. Defaults to . + /// Gets or sets the culture used when reading JSON. + /// The default value is . /// public CultureInfo Culture { @@ -431,7 +429,7 @@ namespace Newtonsoft.Json /// /// Gets a value indicating whether there will be a check for additional content after deserializing an object. - /// By default set to false. + /// The default value is false. /// /// /// true if there will be a check for additional content after deserializing an object; otherwise, false.