Skip to content

Commit

Permalink
support for EnumeratedDescription to better describe enumerated prope…
Browse files Browse the repository at this point in the history
…rty values
  • Loading branch information
martintajur committed Jun 28, 2012
1 parent e3ebdaa commit 2f7b489
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -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
=======
Expand Down
8 changes: 7 additions & 1 deletion views/api.jade
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f7b489

Please sign in to comment.