Ejemplo n.º 1
0
        /// <summary>
        /// Add an `allOf` keyword to the schema.
        /// </summary>
        public static JsonSchema AllOf(this JsonSchema schema, params JsonSchema[] definitions)
        {
            var keyword = schema.OfType <AllOfKeyword>().FirstOrDefault();

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

            keyword.AddRange(definitions);

            return(schema);
        }