-Rewrote JsonTextReader to use internal buffer to improve performance
-Improved JsonSerializer to cache contract/converters where possible to improve performance -Improved JsonTextReader error message when additional JSON content found -Fixed internal exception thrown when deserializing Decimal/DateTimeOffset/Byte lists -Fixed various JsonTextReader bugs
This commit is contained in:
@@ -291,6 +291,14 @@ namespace Newtonsoft.Json.Schema
|
||||
CurrentSchema.Items.Add(GenerateInternal(collectionItemType, (!allowNullItem) ? Required.Always : Required.Default, false));
|
||||
}
|
||||
}
|
||||
else if (contract is JsonStringContract)
|
||||
{
|
||||
JsonSchemaType schemaType = (!ReflectionUtils.IsNullable(contract.UnderlyingType))
|
||||
? JsonSchemaType.String
|
||||
: AddNullType(JsonSchemaType.String, valueRequired);
|
||||
|
||||
CurrentSchema.Type = schemaType;
|
||||
}
|
||||
else if (contract is JsonPrimitiveContract)
|
||||
{
|
||||
CurrentSchema.Type = GetJsonSchemaType(type, valueRequired);
|
||||
@@ -324,14 +332,6 @@ namespace Newtonsoft.Json.Schema
|
||||
GenerateISerializableContract(type, (JsonISerializableContract) contract);
|
||||
}
|
||||
#endif
|
||||
else if (contract is JsonStringContract)
|
||||
{
|
||||
JsonSchemaType schemaType = (!ReflectionUtils.IsNullable(contract.UnderlyingType))
|
||||
? JsonSchemaType.String
|
||||
: AddNullType(JsonSchemaType.String, valueRequired);
|
||||
|
||||
CurrentSchema.Type = schemaType;
|
||||
}
|
||||
else if (contract is JsonLinqContract)
|
||||
{
|
||||
CurrentSchema.Type = JsonSchemaType.Any;
|
||||
|
||||
Reference in New Issue
Block a user