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

ValidateNotDisallowed() private method

private ValidateNotDisallowed ( JsonSchemaModel schema ) : void
schema Newtonsoft.Json.Schema.JsonSchemaModel
return void
        private void ValidateNotDisallowed(JsonSchemaModel schema)
        {
            if (schema == null)
            {
                return;
            }

            JsonSchemaType? currentNodeType = GetCurrentNodeSchemaType();
            if (currentNodeType != null)
            {
                if (JsonSchemaGenerator.HasFlag(schema.Disallow, currentNodeType.GetValueOrDefault()))
                {
                    RaiseError("Type {0} is disallowed.".FormatWith(CultureInfo.InvariantCulture, currentNodeType), schema);
                }
            }
        }