public override bool Equals(object obj)
        {
            var rhs = obj as JsonObjectValidator;

            if (rhs == null)
            {
                return(false);
            }

            if (Required.Count != rhs.Required.Count)
            {
                return(false);
            }
            if (!Required.OrderBy(x => x).SequenceEqual(rhs.Required.OrderBy(x => x)))
            {
                return(false);
            }

            if (Dependencies.Count != rhs.Dependencies.Count)
            {
                return(false);
            }
            foreach (var kv in Dependencies)
            {
                if (!kv.Value.OrderBy(x => x).SequenceEqual(rhs.Dependencies[kv.Key].OrderBy(x => x)))
                {
                    return(false);
                }
            }

            if (AdditionalProperties == null &&
                rhs.AdditionalProperties == null)
            {
                // ok
            }
            else if (AdditionalProperties == null)
            {
                return(false);
            }
            else if (rhs.AdditionalProperties == null)
            {
                return(false);
            }
            else
            {
                if (!AdditionalProperties.Equals(rhs.AdditionalProperties))
                {
                    return(false);
                }
            }

            return(true);
        }
        public override bool Equals(object obj)
        {
            var rhs = obj as JsonObjectValidator;

            if (rhs == null)
            {
                return(false);
            }

            if (Properties.Count != rhs.Properties.Count)
            {
                return(false);
            }
            foreach (var pair in Properties)
            {
                JsonSchema value;
                if (rhs.Properties.TryGetValue(pair.Key, out value))
                {
#if true
                    if (!value.Equals(pair.Value))
                    {
                        Console.WriteLine(string.Format("{0} is not equals", pair.Key));
                        var l = pair.Value.Validator;
                        var r = value.Validator;
                        return(false);
                    }
#else
                    // key name match
                    return(true);
#endif
                }
                else
                {
                    return(false);
                }
            }

            if (Required.Count != rhs.Required.Count)
            {
                return(false);
            }
            if (!Required.OrderBy(x => x).SequenceEqual(rhs.Required.OrderBy(x => x)))
            {
                return(false);
            }

            if (Dependencies.Count != rhs.Dependencies.Count)
            {
                return(false);
            }
            foreach (var kv in Dependencies)
            {
                if (!kv.Value.OrderBy(x => x).SequenceEqual(rhs.Dependencies[kv.Key].OrderBy(x => x)))
                {
                    return(false);
                }
            }

            if (AdditionalProperties == null &&
                rhs.AdditionalProperties == null)
            {
                // ok
            }
            else if (AdditionalProperties == null)
            {
                return(false);
            }
            else if (rhs.AdditionalProperties == null)
            {
                return(false);
            }
            else
            {
                if (!AdditionalProperties.Equals(rhs.AdditionalProperties))
                {
                    return(false);
                }
            }

            return(true);
        }