Permalink
Browse files

support for EnumeratedDescription to better describe enumerated prope…

…rty values
  • Loading branch information...
1 parent e3ebdaa commit 2f7b489bac38678d072fd2e4db4e7d9cc594a78e @martintajur martintajur committed Jun 28, 2012
Showing with 16 additions and 3 deletions.
  1. +9 −2 README.md
  2. +7 −1 views/api.jade
View
@@ -379,6 +379,11 @@ You should look at the *./public/data/* directory for examples.
"sugarbombs",
"frostedteeth"
],
+ "EnumeratedDescription": {
+ "fruitscoops": "Fruit Scoops (packed with fruit goodness)",
+ "sugarbombs": "Sugar Bombs (filled with sugar)",
+ "frostedteeth": "Frosted Teeth (sugar coating)"
+ },
"Description":"The type of cereal desired"
},
{
@@ -425,9 +430,11 @@ Line:
24. "EnumeratedList" key value is an array of enumerated values that will render a drop-down (select box) on the form.
-25. Each value in the list is a string.
+25. "EnumeratedDescription" key value is an object of enumerated values as keys, and their descriptions as values that will be displayed below the Description.
-35. "Type" key value is *boolean* that will render a drop-down (select box) on the form for *true* and *false*.
+26. Each value in the list is a string.
+
+27. "Type" key value is *boolean* that will render a drop-down (select box) on the form for *true* and *false*.
SUPPORT
=======
View
@@ -120,7 +120,13 @@ ul
- else
input(name='params[' + parameter.Name + ']', value=parameter.Default, placeholder=className)
td.type=parameter.Type
- td.description=parameter.Description || 'No description'
+ td.description
+ p=parameter.Description || 'No description'
+ - if (parameter.Type =='enumerated' && parameter.EnumeratedDescription)
+ dl.clearfix
+ - each description, choice in parameter.EnumeratedDescription
+ dt #{choice}
+ dd #{description}
- if (method.headers && method.headers.length > 0)
div.headers
h4.title

0 comments on commit 2f7b489

Please sign in to comment.