コード例 #1
0
 /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
 /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
 /// <param name="other">An object to compare with this object.</param>
 public bool Equals(DependentRequiredKeyword other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(this.ContentsEqual(other));
 }
コード例 #2
0
        /// <summary>
        /// Add a property-based dependency to the `dependencies` keyword.
        /// </summary>
        public static JsonSchema DependentRequired(this JsonSchema schema, string name, params string[] dependencies)
        {
            var keyword = schema.OfType <DependentRequiredKeyword>().FirstOrDefault();

            if (keyword == null)
            {
                keyword = new DependentRequiredKeyword();
                schema.Add(keyword);
            }

            keyword.Add(new PropertyDependency(name, dependencies));

            return(schema);
        }