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

Unified Diff: tools/json_schema_compiler/model.py

Issue 11195058: Extensions Docs Server: Show parameters of functions that are properties of an object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add return types Created 8 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/templates/private/parameter_full.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/model.py
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index a7aaac32dc2c1fef9674dbd8b10fd8766e417edd..87897cd1d9f8618fae7b854beab99cac26d48552 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -229,6 +229,8 @@ class Property(object):
self.from_json = from_json
self.from_client = from_client
self.instance_of = json.get('isInstanceOf', None)
+ self.params = []
+ self.returns = None
_AddProperties(self, json, namespace)
if is_additional_properties:
self.type_ = PropertyType.ADDITIONAL_PROPERTIES
@@ -257,6 +259,16 @@ class Property(object):
# self.properties will already have some value from |_AddProperties|.
self.properties.update(type_.properties)
self.functions = type_.functions
+ elif self.type_ == PropertyType.FUNCTION:
+ for p in json.get('parameters', []):
+ self.params.append(Property(self,
+ p['name'],
+ p,
+ namespace,
+ from_json=from_json,
+ from_client=from_client))
+ if 'returns' in json:
+ self.returns = Property(self, 'return', json['returns'], namespace)
elif 'choices' in json:
if not json['choices'] or len(json['choices']) == 0:
raise ParseException(self, 'Choices has no choices')
« no previous file with comments | « chrome/common/extensions/docs/templates/private/parameter_full.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698