(properties)
| 39 | |
| 40 | |
| 41 | def output_range(properties): |
| 42 | if 'maximum' and 'minimum' in properties: |
| 43 | output(" ({} to {} inclusive)".format(properties['minimum'], |
| 44 | properties['maximum'])) |
| 45 | elif 'maximum' in properties: |
| 46 | output(" (max {})".format(properties['maximum'])) |
| 47 | elif 'minimum' in properties: |
| 48 | output(" (min {})".format(properties['minimum'])) |
| 49 | |
| 50 | if 'maxLength' and 'minLength' in properties: |
| 51 | if properties['minLength'] == properties['maxLength']: |
| 52 | output(' (always {} characters)'.format(properties['minLength'])) |
| 53 | else: |
| 54 | output(' ({} to {} characters)'.format(properties['minLength'], |
| 55 | properties['maxLength'])) |
| 56 | elif 'maxLength' in properties: |
| 57 | output(' (up to {} characters)'.format(properties['maxLength'])) |
| 58 | elif 'minLength' in properties: |
| 59 | output(' (at least {} characters)'.format(properties['minLength'])) |
| 60 | |
| 61 | if 'enum' in properties: |
| 62 | if len(properties['enum']) == 1: |
| 63 | output(" (always {})".format(json_value(properties['enum'][0]))) |
| 64 | else: |
| 65 | output(' (one of {})'.format(', '.join([json_value(p) for p in properties['enum']]))) |
| 66 | |
| 67 | |
| 68 | def fmt_propname(propname): |
no test coverage detected