1[
2  {
3    "namespace": "choices",
4    "description": "The choices API.",
5    "types": [
6      {
7        "id": "ChoiceType",
8        "type": "object",
9        "properties": {
10          "integers": {
11            "choices": [
12               {"type": "array", "items": {"type": "integer", "minimum": 0}},
13               {"type": "integer"}
14            ]
15          },
16          "strings": {
17            "choices": [
18               {"type": "array", "items": {"type": "string", "minimum": 0}},
19               {"type": "string"}
20            ],
21            "optional": true
22          }
23        }
24      },
25      {
26        "id": "NestedChoice",
27        "description": "Tests when some of the choices are choices themselves",
28        "choices": [
29          {"type": "integer"},
30          {"choices": [
31            {"type": "string"},
32            {"type": "boolean"}
33          ]},
34          {"choices": [
35            {"type": "double"},
36            {"$ref": "ChoiceType"},
37            {"type": "array", "items": {"$ref": "ChoiceType"}}
38          ]}
39        ]
40      }
41    ],
42    "functions": [
43      {
44        "name": "takesIntegers",
45        "type": "function",
46        "description": "Takes one or more integers.",
47        "parameters": [
48          {
49            "name": "nums",
50            "choices": [
51               {"type": "array", "items": {"type": "integer", "minimum": 0}},
52               {"type": "integer"}
53             ]
54          },
55          {
56            "name": "callback",
57            "type": "function",
58            "parameters": []
59          }
60        ]
61      },
62      {
63        "name": "takesIntegersOptional",
64        "type": "function",
65        "description": "Takes one or more integers.",
66        "parameters": [
67          {
68            "name": "nums",
69            "choices": [
70               {"type": "array", "items": {"type": "integer", "minimum": 0}},
71               {"type": "integer"}
72            ],
73            "optional": true
74          },
75          {
76            "name": "callback",
77            "type": "function",
78            "parameters": []
79          }
80        ]
81      },
82      {
83        "name": "objectWithChoices",
84        "type": "function",
85        "description": "Takes an object with one or more strings and optional integer(s).",
86        "parameters": [
87          {
88            "type": "object",
89            "name": "stringInfo",
90            "properties": {
91               "strings": {
92                 "description": "One or more tab indices to highlight.",
93                 "choices": [
94                   {"type": "array", "items": {"type": "string", "minimum": 0}},
95                   {"type": "string"}
96                 ]
97               },
98               "integers": {
99                 "description": "One or more tab indices to highlight.",
100                 "choices": [
101                   {"type": "array", "items": {"type": "integer", "minimum": 0}},
102                   {"type": "integer"}
103                 ],
104                 "optional": true
105               }
106             }
107           },
108          {
109            "name": "callback",
110            "type": "function",
111            "parameters": []
112          }
113        ]
114      },
115      {
116        "name": "returnChoices",
117        "type": "function",
118        "description": "Gives back a string. Or not.",
119        "parameters": [
120          {
121            "name": "callback",
122            "type": "function",
123            "parameters": [
124              {
125                "name": "result",
126                "choices": [
127                   {"type": "array", "items": {"type": "integer", "minimum": 0}},
128                   {"type": "integer"}
129                 ],
130                "description": "Some integers."
131              }
132            ]
133          }
134        ]
135      },
136      {
137        "name": "returnMultipleChoices",
138        "type": "function",
139        "description": "Gives back two values where each is an integer or a list of integers.",
140        "parameters": [
141          {
142            "name": "callback",
143            "type": "function",
144            "parameters": [
145              {
146                "name": "firstResult",
147                "choices": [
148                   {"type": "array", "items": {"type": "integer", "minimum": 0}},
149                   {"type": "integer"}
150                 ],
151                "description": "Some integers."
152              },
153              {
154                "name": "secondResult",
155                "choices": [
156                   {"type": "array", "items": {"type": "integer", "minimum": 0}},
157                   {"type": "integer"}
158                 ],
159                "description": "Some integers."
160              }
161            ]
162          }
163        ]
164      }
165    ]
166  }
167]
168