(item, type, is_array=False, map_binary_to_string=False)
| 17 | |
| 18 | |
| 19 | def assignType(item, type, is_array=False, map_binary_to_string=False): |
| 20 | if is_array: |
| 21 | item['type'] = 'array' |
| 22 | item['items'] = collections.OrderedDict() |
| 23 | assignType(item['items'], type, False, map_binary_to_string) |
| 24 | return |
| 25 | |
| 26 | if type == 'enum': |
| 27 | type = 'string' |
| 28 | if map_binary_to_string and type == 'binary': |
| 29 | type = 'string' |
| 30 | if 'description' in item: |
| 31 | item['description'] = (item['description'] + |
| 32 | ' (Encoded as a base64 string when passed over JSON)') |
| 33 | if type in primitiveTypes: |
| 34 | item['type'] = type |
| 35 | else: |
| 36 | item['$ref'] = type |
| 37 | |
| 38 | |
| 39 | def createItem(d, experimental, deprecated, name=None): |
no outgoing calls
no test coverage detected
searching dependent graphs…