(properties)
| 98 | |
| 99 | |
| 100 | def output_range(properties): |
| 101 | if 'maximum' and 'minimum' in properties: |
| 102 | output(' ({} to {} inclusive)'.format(properties['minimum'], properties['maximum'])) |
| 103 | elif 'maximum' in properties: |
| 104 | output(' (max {})'.format(properties['maximum'])) |
| 105 | elif 'minimum' in properties: |
| 106 | output(' (min {})'.format(properties['minimum'])) |
| 107 | |
| 108 | if 'maxLength' and 'minLength' in properties: |
| 109 | if properties['minLength'] == properties['maxLength']: |
| 110 | output(' (always {} characters)'.format(properties['minLength'])) |
| 111 | else: |
| 112 | output(' ({} to {} characters)'.format(properties['minLength'], properties['maxLength'])) |
| 113 | elif 'maxLength' in properties: |
| 114 | output(' (up to {} characters)'.format(properties['maxLength'])) |
| 115 | elif 'minLength' in properties: |
| 116 | output(' (at least {} characters)'.format(properties['minLength'])) |
| 117 | |
| 118 | if 'enum' in properties: |
| 119 | if len(properties['enum']) == 1: |
| 120 | output(" (always {})".format(json_value(properties['enum'][0]))) |
| 121 | else: |
| 122 | output(' (one of {})'.format(', '.join([json_value(p) for p in properties['enum']]))) |
| 123 | |
| 124 | |
| 125 | def fmt_propname(propname): |
no test coverage detected