Пример #1
0
        public static bool HasSchema(this JSONDocument document, IJSONSchemaEvaluationReportCache cache)
        {
            if (document == null || cache == null)
                return false;

            JSONObject schema = cache.DetermineSchemaToUseAsync(document).Result;

            if (schema != null && !string.IsNullOrWhiteSpace(schema.DocumentLocation))
            {
                string currentSchemaFileName = schema.DocumentLocation;

                if (string.Equals(currentSchemaFileName, SchemaFileName, StringComparison.OrdinalIgnoreCase))
                {
                    return true;
                }
            }

            return false;
        }
Пример #2
0
        public static bool HasSchema(this JSONDocument document, IJSONSchemaEvaluationReportCache cache)
        {
            if (document == null || cache == null)
            {
                return(false);
            }

            JSONObject schema = cache.DetermineSchemaToUseAsync(document).Result;

            if (schema != null && !string.IsNullOrWhiteSpace(schema.DocumentLocation))
            {
                string currentSchemaFileName = schema.DocumentLocation;

                if (string.Equals(currentSchemaFileName, SchemaFileName, StringComparison.OrdinalIgnoreCase))
                {
                    return(true);
                }
            }

            return(false);
        }