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

Unified Diff: chrome/common/json_schema/json_schema_validator.h

Issue 14830007: Added a validator for JSON v3 schemas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 months 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: chrome/common/json_schema/json_schema_validator.h
diff --git a/chrome/common/json_schema/json_schema_validator.h b/chrome/common/json_schema/json_schema_validator.h
index e9a1a928a314b7dd2c7eaf216c91a7f4e760e0d6..3b42444c64296ee52ee3f148ee39cac1dc693423 100644
--- a/chrome/common/json_schema/json_schema_validator.h
+++ b/chrome/common/json_schema/json_schema_validator.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
namespace base {
class DictionaryValue;
@@ -98,6 +99,15 @@ class JSONSchemaValidator {
const std::string& s1,
const std::string& s2);
+ // Verifies if |schema| is a valid JSON v3 schema. When this validation passes
+ // then |schema| is valid JSON that can be parsed into a DictionaryValue,
+ // and that DictionaryValue can be used to build a JSONSchemaValidator.
+ // Returns the parsed DictionaryValue when |schema| validated, otherwise
+ // returns NULL. In that case, |error| contains an error description.
+ static scoped_ptr<base::DictionaryValue> IsValidSchema(
+ const std::string& schema,
+ std::string* error);
not at google - send to devlin 2013/05/16 17:08:20 a static Create method which takes a std::string s
Joao da Silva 2013/05/19 13:16:29 The returned DictionaryValue can be used to build
+
// Creates a validator for the specified schema.
//
// NOTE: This constructor assumes that |schema| is well formed and valid.

Powered by Google App Engine
This is Rietveld 408576698