/// <summary>
        /// Gets the Google type for the specified path is valid for this schema.
        /// </summary>
        /// <param name="schema">JSON Schema.</param>
        /// <param name="flattenedPath">Flattened state path.</param>
        /// <returns>The <see cref="GoogleType"/> for the specified path.</returns>
        public static GoogleType GetGoogleTypeForFlattenedPath(this NJsonSchema.JsonSchema schema, string flattenedPath)
        {
            var foundSchemas = schema.GetByFlattenedPath(flattenedPath);

            if (!foundSchemas.Any())
            {
                return(GoogleType.Unknown);
            }

            foreach (var foundSchema in foundSchemas)
            {
                switch (foundSchema.Type)
                {
                case NJsonSchema.JsonObjectType.Integer:
                case NJsonSchema.JsonObjectType.Number:
                    return(GoogleType.Numeric);

                case NJsonSchema.JsonObjectType.Boolean:
                    return(GoogleType.Bool);

                case NJsonSchema.JsonObjectType.String:
                    return(GoogleType.String);
                }
            }

            return(GoogleType.Unknown);
        }
        /// <summary>
        /// Gets the Google type for the specified path is valid for this schema.
        /// </summary>
        /// <param name="schema">JSON Schema.</param>
        /// <param name="flattenedPath">Flattened state path.</param>
        /// <returns>The <see cref="GoogleType"/> for the specified path.</returns>
        public static ICollection <object> GetEnumValuesForFlattenedPath(this NJsonSchema.JsonSchema schema, string flattenedPath)
        {
            var foundSchemas = schema.GetByFlattenedPath(flattenedPath);

            var result = new List <object>();

            foreach (var foundSchema in foundSchemas)
            {
                if (foundSchema.IsEnumeration)
                {
                    result.AddRange(foundSchema.Enumeration);
                }
            }

            return(result.Any() ? result : null);
        }
 /// <summary>
 /// Validates if the specified path is valid for this schema.
 /// </summary>
 /// <param name="schema">JSON Schema.</param>
 /// <param name="flattenedPath">Flattened state path.</param>
 /// <returns><c>true</c> if path is valid for schema, otherwise <c>false</c>.</returns>
 public static bool FlattenedPathExists(this NJsonSchema.JsonSchema schema, string flattenedPath)
 {
     return(schema.GetByFlattenedPath(flattenedPath).Any());
 }