Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Unified Diff: components/policy/core/common/schema.cc

Issue 94043003: Ignore unknown attributes when parsing JSON schemas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added Options enum Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/schema.cc
diff --git a/components/policy/core/common/schema.cc b/components/policy/core/common/schema.cc
index 0129094c75a0da6773318f81e40b3dfca581177c..5f0cc18db875a1e34c2695699fdf5867f7b85461 100644
--- a/components/policy/core/common/schema.cc
+++ b/components/policy/core/common/schema.cc
@@ -500,9 +500,10 @@ bool Schema::Validate(const base::Value& value) const {
// static
Schema Schema::Parse(const std::string& content, std::string* error) {
- // Validate as a generic JSON schema.
- scoped_ptr<base::DictionaryValue> dict =
- JSONSchemaValidator::IsValidSchema(content, error);
+ // Validate as a generic JSON schema, and ignore unknown attributes; they
+ // may become used in a future version of the schema format.
+ scoped_ptr<base::DictionaryValue> dict = JSONSchemaValidator::IsValidSchema(
+ content, JSONSchemaValidator::OPTIONS_IGNORE_UNKNOWN_ATTRIBUTES, error);
if (!dict)
return Schema();
« no previous file with comments | « components/json_schema/json_schema_validator_unittest.cc ('k') | components/policy/core/common/schema_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698