Home | History | Annotate | Download | only in test
      1 [
      2   {
      3     "namespace": "enums",
      4     "description": "The enums API.",
      5     "types": [
      6       {
      7         "id": "Enumeration",
      8         "type": "string",
      9         "enum": ["one", "two", "three"]
     10       },
     11       {
     12         "id": "EnumType",
     13         "type": "object",
     14         "properties": {
     15           "type": {
     16             "type": "string",
     17             "enum": ["one", "two", "three"]
     18           }
     19         }
     20       },
     21       {
     22         "id": "HasEnumeration",
     23         "type": "object",
     24         "properties": {
     25           "enumeration": {
     26             "$ref": "Enumeration"
     27           },
     28           "optional_enumeration": {
     29             "$ref": "Enumeration",
     30             "optional": true
     31           }
     32         }
     33       },
     34       {
     35         "id": "OptionalEnumType",
     36         "type": "object",
     37         "properties": {
     38           "type": {
     39             "type": "string",
     40             "enum": ["one", "two", "three"],
     41             "optional": true
     42           }
     43         }
     44       }
     45     ],
     46     "functions": [
     47       {
     48         "name": "takesEnum",
     49         "type": "function",
     50         "description": "Takes an enum as its parameter.",
     51         "parameters": [
     52           {
     53             "name": "state",
     54             "type": "string",
     55             "enum": ["foo", "bar", "baz"]
     56           },
     57           {
     58             "name": "callback",
     59             "type": "function",
     60             "parameters": []
     61           }
     62         ]
     63       },
     64       {
     65         "name": "takesEnumArray",
     66         "type": "function",
     67         "description": "Takes an enum array as its parameter.",
     68         "parameters": [
     69           {
     70             "name": "values",
     71             "type": "array",
     72             "items": {
     73               "type": "string",
     74               "enum": ["foo", "bar", "baz"]
     75             }
     76           },
     77           {
     78             "name": "callback",
     79             "type": "function",
     80             "parameters": []
     81           }
     82         ]
     83       },
     84       {
     85         "name": "takesEnumAsType",
     86         "type": "function",
     87         "description": "Takes an enum type as its parameter.",
     88         "parameters": [
     89           {
     90             "name": "enumeration",
     91             "$ref": "Enumeration"
     92           },
     93           {
     94             "name": "callback",
     95             "type": "function",
     96             "parameters": []
     97           }
     98         ]
     99       },
    100       {
    101         "name": "takesEnumArrayAsType",
    102         "type": "function",
    103         "description": "Takes an enum type array as its parameter.",
    104         "parameters": [
    105           {
    106             "name": "values",
    107             "type": "array",
    108             "items": {
    109               "$ref": "Enumeration"
    110             }
    111           },
    112           {
    113             "name": "callback",
    114             "type": "function",
    115             "parameters": []
    116           }
    117         ]
    118       },
    119       {
    120         "name": "returnsEnum",
    121         "type": "function",
    122         "description": "Returns an enum through the callback",
    123         "parameters": [
    124           {
    125             "name": "callback",
    126             "type": "function",
    127             "parameters": [
    128               {
    129                 "name": "state",
    130                 "type": "string",
    131                 "enum": ["foo", "bar", "baz"]
    132               }
    133             ]
    134           }
    135         ]
    136       },
    137       {
    138         "name": "returnsEnumAsType",
    139         "type": "function",
    140         "description": "Returns an enum through the callback",
    141         "parameters": [
    142           {
    143             "name": "callback",
    144             "type": "function",
    145             "parameters": [
    146               {
    147                 "name": "enumeration",
    148                 "$ref": "Enumeration"
    149               }
    150             ]
    151           }
    152         ]
    153       },
    154       {
    155         "name": "returnsTwoEnums",
    156         "type": "function",
    157         "description": "Returns two enums through the callback",
    158         "parameters": [
    159           {
    160             "name": "callback",
    161             "type": "function",
    162             "parameters": [
    163               {
    164                 "name": "firstState",
    165                 "type": "string",
    166                 "enum": ["foo", "bar", "baz"]
    167               },
    168               {
    169                 "name": "secondState",
    170                 "type": "string",
    171                 "enum": ["spam", "ham", "eggs"]
    172               }
    173             ]
    174           }
    175         ]
    176       },
    177       {
    178         "name": "takesOptionalEnum",
    179         "type": "function",
    180         "description": "Takes an enum as its parameter.",
    181         "parameters": [
    182           {
    183             "name": "state",
    184             "type": "string",
    185             "enum": ["foo", "bar", "baz"],
    186             "optional": true
    187           },
    188           {
    189             "name": "callback",
    190             "type": "function",
    191             "parameters": []
    192           }
    193         ]
    194       },
    195       {
    196         "name": "takesMultipleOptionalEnums",
    197         "type": "function",
    198         "description": "Takes two enums as parameters.",
    199         "parameters": [
    200           {
    201             "name": "state",
    202             "type": "string",
    203             "enum": ["foo", "bar", "baz"],
    204             "optional": true
    205           },
    206           {
    207             "name": "type",
    208             "type": "string",
    209             "enum": ["foo", "ding", "dong"],
    210             "optional": true
    211           },
    212           {
    213             "name": "callback",
    214             "type": "function",
    215             "parameters": []
    216           }
    217         ]
    218       }
    219     ],
    220     "events": [
    221       {
    222         "name": "onEnumFired",
    223         "type": "function",
    224         "description": "Fired when an enum is ready.",
    225         "parameters": [
    226           {
    227             "name": "someEnum",
    228             "type": "string",
    229             "enum": ["foo", "bar", "baz"]
    230           }
    231         ]
    232       },
    233       {
    234         "name": "onTwoEnumsFired",
    235         "type": "function",
    236         "description": "Fired when two enums are ready.",
    237         "parameters": [
    238           {
    239             "name": "firstEnum",
    240             "type": "string",
    241             "enum": ["foo", "bar", "baz"]
    242           },
    243           {
    244             "name": "secondEnum",
    245             "type": "string",
    246             "enum": ["spam", "ham", "eggs"]
    247           }
    248         ]
    249       }
    250     ]
    251   }
    252 ]
    253