private JsonSchemaType? ProcessType()
{
switch (_reader.TokenType)
{
case JsonToken.String:
return MapType(_reader.Value.ToString());
case JsonToken.StartArray:
// ensure type is in blank state before ORing values
JsonSchemaType? type = JsonSchemaType.None;
while (_reader.Read() && _reader.TokenType != JsonToken.EndArray)
{
if (_reader.TokenType != JsonToken.String)
throw new Exception("Exception JSON schema type string token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType));
type = type | MapType(_reader.Value.ToString());
}
return type;
default:
throw new Exception("Expected array or JSON schema type string token, got {0}.".FormatWith(CultureInfo.InvariantCulture, _reader.TokenType));
}
}