cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft7/optional/format/hostname.json (about)

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