Generate description line(s) for this member
(propname, properties, is_optional, indent, print_type=True, prefix=None)
| 71 | |
| 72 | |
| 73 | def output_member(propname, properties, is_optional, indent, print_type=True, prefix=None): |
| 74 | """Generate description line(s) for this member""" |
| 75 | |
| 76 | if prefix is None: |
| 77 | prefix = '- ' + fmt_propname(propname) |
| 78 | output(indent + prefix) |
| 79 | |
| 80 | # We make them explicitly note if they don't want a type! |
| 81 | is_untyped = 'untyped' in properties |
| 82 | |
| 83 | if not is_untyped and print_type: |
| 84 | output_type(properties, is_optional) |
| 85 | |
| 86 | if 'description' in properties: |
| 87 | output(": {}".format(properties['description'])) |
| 88 | |
| 89 | output_range(properties) |
| 90 | |
| 91 | if not is_untyped and properties['type'] == 'object': |
| 92 | output(':\n') |
| 93 | output_members(properties, indent + ' ') |
| 94 | elif not is_untyped and properties['type'] == 'array': |
| 95 | output(':\n') |
| 96 | output_array(properties['items'], indent + ' ') |
| 97 | else: |
| 98 | output('\n') |
| 99 | |
| 100 | |
| 101 | def output_array(items, indent): |
no test coverage detected