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

ValidateEndObject() private method

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

            Dictionary<string, bool> requiredProperties = _currentScope.RequiredProperties;

            if (requiredProperties != null)
            {
                List<string> unmatchedRequiredProperties =
                    requiredProperties.Where(kv => !kv.Value).Select(kv => kv.Key).ToList();

                if (unmatchedRequiredProperties.Count > 0)
                {
                    RaiseError("Required properties are missing from object: {0}.".FormatWith(CultureInfo.InvariantCulture, string.Join(", ", unmatchedRequiredProperties.ToArray())), schema);
                }
            }
        }