cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft2019-09/optional/format/hostname.json (about) 1 [ 2 { 3 "description": "validation of host names", 4 "schema": { 5 "$schema": "https://json-schema.org/draft/2019-09/schema", 6 "format": "hostname" 7 }, 8 "tests": [ 9 { 10 "description": "all string formats ignore integers", 11 "data": 12, 12 "valid": true 13 }, 14 { 15 "description": "all string formats ignore floats", 16 "data": 13.7, 17 "valid": true 18 }, 19 { 20 "description": "all string formats ignore objects", 21 "data": {}, 22 "valid": true 23 }, 24 { 25 "description": "all string formats ignore arrays", 26 "data": [], 27 "valid": true 28 }, 29 { 30 "description": "all string formats ignore booleans", 31 "data": false, 32 "valid": true 33 }, 34 { 35 "description": "all string formats ignore nulls", 36 "data": null, 37 "valid": true 38 }, 39 { 40 "description": "a valid host name", 41 "data": "www.example.com", 42 "valid": true 43 }, 44 { 45 "description": "a valid punycoded IDN hostname", 46 "data": "xn--4gbwdl.xn--wgbh1c", 47 "valid": true 48 }, 49 { 50 "description": "a host name starting with an illegal character", 51 "data": "-a-host-name-that-starts-with--", 52 "valid": false, 53 "skip": { 54 "v2": "unexpected success", 55 "v3": "unexpected success" 56 } 57 }, 58 { 59 "description": "a host name containing illegal characters", 60 "data": "not_a_valid_host_name", 61 "valid": false, 62 "skip": { 63 "v2": "unexpected success", 64 "v3": "unexpected success" 65 } 66 }, 67 { 68 "description": "a host name with a component too long", 69 "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", 70 "valid": false, 71 "skip": { 72 "v2": "unexpected success", 73 "v3": "unexpected success" 74 } 75 }, 76 { 77 "description": "starts with hyphen", 78 "data": "-hostname", 79 "valid": false, 80 "skip": { 81 "v2": "unexpected success", 82 "v3": "unexpected success" 83 } 84 }, 85 { 86 "description": "ends with hyphen", 87 "data": "hostname-", 88 "valid": false, 89 "skip": { 90 "v2": "unexpected success", 91 "v3": "unexpected success" 92 } 93 }, 94 { 95 "description": "starts with underscore", 96 "data": "_hostname", 97 "valid": false, 98 "skip": { 99 "v2": "unexpected success", 100 "v3": "unexpected success" 101 } 102 }, 103 { 104 "description": "ends with underscore", 105 "data": "hostname_", 106 "valid": false, 107 "skip": { 108 "v2": "unexpected success", 109 "v3": "unexpected success" 110 } 111 }, 112 { 113 "description": "contains underscore", 114 "data": "host_name", 115 "valid": false, 116 "skip": { 117 "v2": "unexpected success", 118 "v3": "unexpected success" 119 } 120 }, 121 { 122 "description": "maximum label length", 123 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", 124 "valid": true 125 }, 126 { 127 "description": "exceeds maximum label length", 128 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", 129 "valid": false, 130 "skip": { 131 "v2": "unexpected success", 132 "v3": "unexpected success" 133 } 134 }, 135 { 136 "description": "single label", 137 "data": "hostname", 138 "valid": true 139 }, 140 { 141 "description": "single label with hyphen", 142 "data": "host-name", 143 "valid": true 144 }, 145 { 146 "description": "single label with digits", 147 "data": "h0stn4me", 148 "valid": true 149 }, 150 { 151 "description": "single label starting with digit", 152 "data": "1host", 153 "valid": true 154 }, 155 { 156 "description": "single label ending with digit", 157 "data": "hostnam3", 158 "valid": true 159 } 160 ] 161 } 162 ]