Пример #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(DependentSchemasKeyword other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(this.ContentsEqual(other));
 }
Пример #2
0
        /// <summary>
        /// Add a schema-based dependency to the `dependencies` keyword.
        /// </summary>
        public static JsonSchema DependentSchema(this JsonSchema schema, string name, JsonSchema dependency)
        {
            var keyword = schema.OfType <DependentSchemasKeyword>().FirstOrDefault();

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

            keyword.Add(new SchemaDependency(name, dependency));

            return(schema);
        }