/// <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(DependenciesKeyword other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(this.ContentsEqual(other)); }
/// <summary> /// Add a schema-based dependency to the <code>dependencies</code> keyword. /// </summary> public static JsonSchema Dependency(this JsonSchema schema, string name, JsonSchema dependency) { var keyword = schema.OfType <DependenciesKeyword>().FirstOrDefault(); if (keyword == null) { keyword = new DependenciesKeyword(); schema.Add(keyword); } keyword.Add(new SchemaDependency(name, dependency)); return(schema); }