Newtonsoft.Json.JsonValidatingReader.TestType C# (CSharp) Method

TestType() private method

private TestType ( JsonSchemaModel currentSchema, JsonSchemaType currentType ) : bool
currentSchema Newtonsoft.Json.Schema.JsonSchemaModel
currentType JsonSchemaType
return bool
        private bool TestType(JsonSchemaModel currentSchema, JsonSchemaType currentType)
        {
            if (!JsonSchemaGenerator.HasFlag(currentSchema.Type, currentType))
            {
                RaiseError("Invalid type. Expected {0} but got {1}.".FormatWith(CultureInfo.InvariantCulture, currentSchema.Type, currentType), currentSchema);
                return false;
            }

            return true;
        }