Debian Codegraph @

encoding/jsonschema/testdata/external/tests/draft2020-12/optional/format/date-time.json

raw
1 [
2 {
3 "description": "validation of date-time strings",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2020-12/schema",
6 "format": "date-time"
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 date-time string",
41 "data": "1963-06-19T08:30:06.283185Z",
42 "valid": true
43 },
44 {
45 "description": "a valid date-time string without second fraction",
46 "data": "1963-06-19T08:30:06Z",
47 "valid": true
48 },
49 {
50 "description": "a valid date-time string with plus offset",
51 "data": "1937-01-01T12:00:27.87+00:20",
52 "valid": true
53 },
54 {
55 "description": "a valid date-time string with minus offset",
56 "data": "1990-12-31T15:59:50.123-08:00",
57 "valid": true
58 },
59 {
60 "description": "a valid date-time with a leap second, UTC",
61 "data": "1998-12-31T23:59:60Z",
62 "valid": true,
63 "skip": {
64 "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n"
65 }
66 },
67 {
68 "description": "a valid date-time with a leap second, with minus offset",
69 "data": "1998-12-31T15:59:60.123-08:00",
70 "valid": true,
71 "skip": {
72 "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n"
73 }
74 },
75 {
76 "description": "an invalid date-time past leap second, UTC",
77 "data": "1998-12-31T23:59:61Z",
78 "valid": false,
79 "skip": {
80 "v3-roundtrip": "unexpected success"
81 }
82 },
83 {
84 "description": "an invalid date-time with leap second on a wrong minute, UTC",
85 "data": "1998-12-31T23:58:60Z",
86 "valid": false,
87 "skip": {
88 "v3-roundtrip": "unexpected success"
89 }
90 },
91 {
92 "description": "an invalid date-time with leap second on a wrong hour, UTC",
93 "data": "1998-12-31T22:59:60Z",
94 "valid": false,
95 "skip": {
96 "v3-roundtrip": "unexpected success"
97 }
98 },
99 {
100 "description": "an invalid day in date-time string",
101 "data": "1990-02-31T15:59:59.123-08:00",
102 "valid": false,
103 "skip": {
104 "v3-roundtrip": "unexpected success"
105 }
106 },
107 {
108 "description": "an invalid offset in date-time string",
109 "data": "1990-12-31T15:59:59-24:00",
110 "valid": false,
111 "skip": {
112 "v3": "unexpected success",
113 "v3-roundtrip": "unexpected success"
114 }
115 },
116 {
117 "description": "an invalid closing Z after time-zone offset",
118 "data": "1963-06-19T08:30:06.28123+01:00Z",
119 "valid": false,
120 "skip": {
121 "v3-roundtrip": "unexpected success"
122 }
123 },
124 {
125 "description": "an invalid date-time string",
126 "data": "06/19/1963 08:30:06 PST",
127 "valid": false,
128 "skip": {
129 "v3-roundtrip": "unexpected success"
130 }
131 },
132 {
133 "description": "case-insensitive T and Z",
134 "data": "1963-06-19t08:30:06.283185z",
135 "valid": true,
136 "skip": {
137 "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n"
138 }
139 },
140 {
141 "description": "only RFC3339 not all of ISO 8601 are valid",
142 "data": "2013-350T01:01:01",
143 "valid": false,
144 "skip": {
145 "v3-roundtrip": "unexpected success"
146 }
147 },
148 {
149 "description": "invalid non-padded month dates",
150 "data": "1963-6-19T08:30:06.283185Z",
151 "valid": false,
152 "skip": {
153 "v3-roundtrip": "unexpected success"
154 }
155 },
156 {
157 "description": "invalid non-padded day dates",
158 "data": "1963-06-1T08:30:06.283185Z",
159 "valid": false,
160 "skip": {
161 "v3-roundtrip": "unexpected success"
162 }
163 },
164 {
165 "description": "invalid non-ASCII '৪' (a Bengali 4) in date portion",
166 "data": "1963-06-1৪T00:00:00Z",
167 "valid": false,
168 "skip": {
169 "v3-roundtrip": "unexpected success"
170 }
171 },
172 {
173 "description": "invalid non-ASCII '৪' (a Bengali 4) in time portion",
174 "data": "1963-06-11T0৪:00:00Z",
175 "valid": false,
176 "skip": {
177 "v3-roundtrip": "unexpected success"
178 }
179 }
180 ]
181 }
182 ]