github.com/kaptinlin/jsonschema@v0.4.6/testdata/JSON-Schema-Test-Suite/tests/draft7/optional/format/hostname.json (about) 1 [ 2 { 3 "description": "validation of host names", 4 "schema": { "format": "hostname" }, 5 "tests": [ 6 { 7 "description": "all string formats ignore integers", 8 "data": 12, 9 "valid": true 10 }, 11 { 12 "description": "all string formats ignore floats", 13 "data": 13.7, 14 "valid": true 15 }, 16 { 17 "description": "all string formats ignore objects", 18 "data": {}, 19 "valid": true 20 }, 21 { 22 "description": "all string formats ignore arrays", 23 "data": [], 24 "valid": true 25 }, 26 { 27 "description": "all string formats ignore booleans", 28 "data": false, 29 "valid": true 30 }, 31 { 32 "description": "all string formats ignore nulls", 33 "data": null, 34 "valid": true 35 }, 36 { 37 "description": "a valid host name", 38 "data": "www.example.com", 39 "valid": true 40 }, 41 { 42 "description": "a valid punycoded IDN hostname", 43 "data": "xn--4gbwdl.xn--wgbh1c", 44 "valid": true 45 }, 46 { 47 "description": "a host name starting with an illegal character", 48 "data": "-a-host-name-that-starts-with--", 49 "valid": false 50 }, 51 { 52 "description": "a host name containing illegal characters", 53 "data": "not_a_valid_host_name", 54 "valid": false 55 }, 56 { 57 "description": "a host name with a component too long", 58 "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", 59 "valid": false 60 }, 61 { 62 "description": "starts with hyphen", 63 "data": "-hostname", 64 "valid": false 65 }, 66 { 67 "description": "ends with hyphen", 68 "data": "hostname-", 69 "valid": false 70 }, 71 { 72 "description": "starts with underscore", 73 "data": "_hostname", 74 "valid": false 75 }, 76 { 77 "description": "ends with underscore", 78 "data": "hostname_", 79 "valid": false 80 }, 81 { 82 "description": "contains underscore", 83 "data": "host_name", 84 "valid": false 85 }, 86 { 87 "description": "maximum label length", 88 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com", 89 "valid": true 90 }, 91 { 92 "description": "exceeds maximum label length", 93 "data": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl.com", 94 "valid": false 95 }, 96 { 97 "description": "single label", 98 "data": "hostname", 99 "valid": true 100 }, 101 { 102 "description": "single label with hyphen", 103 "data": "host-name", 104 "valid": true 105 }, 106 { 107 "description": "single label with digits", 108 "data": "h0stn4me", 109 "valid": true 110 }, 111 { 112 "description": "single label ending with digit", 113 "data": "hostnam3", 114 "valid": true 115 } 116 ] 117 } 118 ]