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

Unified Diff: chrome/common/extensions/docs/js/api_page_generator.js

Issue 8411001: Fix generation of API documentation for arrays of objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « chrome/common/extensions/docs/extension.html ('k') | chrome/common/extensions/docs/webNavigation.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/js/api_page_generator.js
diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js
index b98774ce2dea33e1a63d9388bc45e7551210490a..20a6573e2f8092faf1720c6503d413c4744ef102 100644
--- a/chrome/common/extensions/docs/js/api_page_generator.js
+++ b/chrome/common/extensions/docs/js/api_page_generator.js
@@ -496,13 +496,18 @@ function getAnchorName(type, name, scope) {
}
function shouldExpandObject(object) {
- return (object.type == "object" && object.properties);
+ return (object.type == "object" && object.properties) ||
+ (object.type == "array" && object.items && object.items.properties);
}
function getPropertyListFromObject(object) {
var propertyList = [];
- for (var p in object.properties) {
- var prop = object.properties[p];
+ var properties = object.properties;
+ if (!properties && object.type === "array" && object.items) {
+ properties = object.items.properties;
+ }
+ for (var p in properties) {
+ var prop = properties[p];
// Do not render properties marked as "nodoc": true.
if (prop.nodoc) {
continue;
« no previous file with comments | « chrome/common/extensions/docs/extension.html ('k') | chrome/common/extensions/docs/webNavigation.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698