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; }
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); }