Index: components/json_schema/json_schema_validator.h |
diff --git a/components/json_schema/json_schema_validator.h b/components/json_schema/json_schema_validator.h |
index 4584a9da77a5be1bf1b17d5babebc46133b3b913..4e8acaddfd983c68b10c02f126e29b6a498cc2ab 100644 |
--- a/components/json_schema/json_schema_validator.h |
+++ b/components/json_schema/json_schema_validator.h |
@@ -70,6 +70,12 @@ class JSONSchemaValidator { |
std::string message; |
}; |
+ enum Options { |
+ // Ignore unknown attributes. If this option is not set then unknown |
+ // attributes will make the schema validation fail. |
+ OPTIONS_IGNORE_UNKNOWN_ATTRIBUTES = 1 << 0, |
+ }; |
+ |
// Error messages. |
static const char kUnknownTypeReference[]; |
static const char kInvalidChoice[]; |
@@ -108,6 +114,13 @@ class JSONSchemaValidator { |
const std::string& schema, |
std::string* error); |
+ // Same as above but with |options|, which is a bitwise-OR combination of the |
+ // Options above. |
+ static scoped_ptr<base::DictionaryValue> IsValidSchema( |
+ const std::string& schema, |
+ int options, |
+ std::string* error); |
+ |
// Creates a validator for the specified schema. |
// |
// NOTE: This constructor assumes that |schema| is well formed and valid. |