Newtonsoft.Json.JsonValidatingReader.ValidateEndArray C# (CSharp) Метод

ValidateEndArray() приватный Метод

private ValidateEndArray ( JsonSchemaModel schema ) : void
schema Newtonsoft.Json.Schema.JsonSchemaModel
Результат void
        private void ValidateEndArray(JsonSchemaModel schema)
        {
            if (schema == null)
            {
                return;
            }

            int arrayItemCount = _currentScope.ArrayItemCount;

            if (schema.MaximumItems != null && arrayItemCount > schema.MaximumItems)
            {
                RaiseError("Array item count {0} exceeds maximum count of {1}.".FormatWith(CultureInfo.InvariantCulture, arrayItemCount, schema.MaximumItems), schema);
            }

            if (schema.MinimumItems != null && arrayItemCount < schema.MinimumItems)
            {
                RaiseError("Array item count {0} is less than minimum count of {1}.".FormatWith(CultureInfo.InvariantCulture, arrayItemCount, schema.MinimumItems), schema);
            }
        }