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

Unified Diff: chrome/renderer/resources/extensions/json_schema.js

Issue 39113003: Docserver: Display enum value descriptions in API docs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 2 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/renderer/resources/extensions/json_schema.js
diff --git a/chrome/renderer/resources/extensions/json_schema.js b/chrome/renderer/resources/extensions/json_schema.js
index 4b8996a4cd22e55f7ace3147dbafe922d8d7d576..7aa435c097834c415caa0c47c4e538626797de30 100644
--- a/chrome/renderer/resources/extensions/json_schema.js
+++ b/chrome/renderer/resources/extensions/json_schema.js
@@ -317,11 +317,13 @@ JSONSchemaValidator.prototype.validateChoices =
*/
JSONSchemaValidator.prototype.validateEnum = function(instance, schema, path) {
for (var i = 0; i < schema.enum.length; i++) {
- if (instance === schema.enum[i])
+ if (instance === (schema.enum[i].name || schema.enum[i]))
not at google - send to devlin 2013/10/28 18:00:25 add function like enumToString; instance == enumTo
Sam McNally 2013/10/29 00:39:02 Done.
return true;
}
- this.addError(path, "invalidEnum", [schema.enum.join(", ")]);
+ this.addError(path, "invalidEnum", [schema.enum.map(function(enumValue) {
+ return enumValue.name || enumValue;
+ }).join(", ")]);
return false;
};

Powered by Google App Engine
This is Rietveld 408576698