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

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: 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
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..7b37466ecce5e505fce5d2e62a6ea7a6c15bed28 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -229,6 +229,7 @@ class Property(object):
self.from_json = from_json
self.from_client = from_client
self.instance_of = json.get('isInstanceOf', None)
+ self.params = []
Aaron Boodman 2012/10/24 22:29:24 I wonder if we also need to model the return value
cduvall 2012/10/25 23:42:02 Done.
_AddProperties(self, json, namespace)
if is_additional_properties:
self.type_ = PropertyType.ADDITIONAL_PROPERTIES
@@ -257,6 +258,14 @@ 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))
elif 'choices' in json:
if not json['choices'] or len(json['choices']) == 0:
raise ParseException(self, 'Choices has no choices')

Powered by Google App Engine
This is Rietveld 408576698