Debian Codegraph @

encoding/jsonschema/testdata/external/tests/draft2019-09/optional/format/duration.json

raw
1 [
2 {
3 "description": "validation of duration strings",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2019-09/schema",
6 "format": "duration"
7 },
8 "skip": {
9 "v3-roundtrip": "generation only supported in version https://json-schema.org/draft/2020-12/schema"
10 },
11 "tests": [
12 {
13 "description": "all string formats ignore integers",
14 "data": 12,
15 "valid": true,
16 "skip": {
17 "v3-roundtrip": "could not extract schema"
18 }
19 },
20 {
21 "description": "all string formats ignore floats",
22 "data": 13.7,
23 "valid": true,
24 "skip": {
25 "v3-roundtrip": "could not extract schema"
26 }
27 },
28 {
29 "description": "all string formats ignore objects",
30 "data": {},
31 "valid": true,
32 "skip": {
33 "v3-roundtrip": "could not extract schema"
34 }
35 },
36 {
37 "description": "all string formats ignore arrays",
38 "data": [],
39 "valid": true,
40 "skip": {
41 "v3-roundtrip": "could not extract schema"
42 }
43 },
44 {
45 "description": "all string formats ignore booleans",
46 "data": false,
47 "valid": true,
48 "skip": {
49 "v3-roundtrip": "could not extract schema"
50 }
51 },
52 {
53 "description": "all string formats ignore nulls",
54 "data": null,
55 "valid": true,
56 "skip": {
57 "v3-roundtrip": "could not extract schema"
58 }
59 },
60 {
61 "description": "a valid duration string",
62 "data": "P4DT12H30M5S",
63 "valid": true,
64 "skip": {
65 "v3-roundtrip": "could not extract schema"
66 }
67 },
68 {
69 "description": "an invalid duration string",
70 "data": "PT1D",
71 "valid": false,
72 "skip": {
73 "v3": "unexpected success",
74 "v3-roundtrip": "could not extract schema"
75 }
76 },
77 {
78 "description": "no elements present",
79 "data": "P",
80 "valid": false,
81 "skip": {
82 "v3": "unexpected success",
83 "v3-roundtrip": "could not extract schema"
84 }
85 },
86 {
87 "description": "no time elements present",
88 "data": "P1YT",
89 "valid": false,
90 "skip": {
91 "v3": "unexpected success",
92 "v3-roundtrip": "could not extract schema"
93 }
94 },
95 {
96 "description": "no date or time elements present",
97 "data": "PT",
98 "valid": false,
99 "skip": {
100 "v3": "unexpected success",
101 "v3-roundtrip": "could not extract schema"
102 }
103 },
104 {
105 "description": "elements out of order",
106 "data": "P2D1Y",
107 "valid": false,
108 "skip": {
109 "v3": "unexpected success",
110 "v3-roundtrip": "could not extract schema"
111 }
112 },
113 {
114 "description": "missing time separator",
115 "data": "P1D2H",
116 "valid": false,
117 "skip": {
118 "v3": "unexpected success",
119 "v3-roundtrip": "could not extract schema"
120 }
121 },
122 {
123 "description": "time element in the date position",
124 "data": "P2S",
125 "valid": false,
126 "skip": {
127 "v3": "unexpected success",
128 "v3-roundtrip": "could not extract schema"
129 }
130 },
131 {
132 "description": "four years duration",
133 "data": "P4Y",
134 "valid": true,
135 "skip": {
136 "v3-roundtrip": "could not extract schema"
137 }
138 },
139 {
140 "description": "zero time, in seconds",
141 "data": "PT0S",
142 "valid": true,
143 "skip": {
144 "v3-roundtrip": "could not extract schema"
145 }
146 },
147 {
148 "description": "zero time, in days",
149 "data": "P0D",
150 "valid": true,
151 "skip": {
152 "v3-roundtrip": "could not extract schema"
153 }
154 },
155 {
156 "description": "one month duration",
157 "data": "P1M",
158 "valid": true,
159 "skip": {
160 "v3-roundtrip": "could not extract schema"
161 }
162 },
163 {
164 "description": "one minute duration",
165 "data": "PT1M",
166 "valid": true,
167 "skip": {
168 "v3-roundtrip": "could not extract schema"
169 }
170 },
171 {
172 "description": "one and a half days, in hours",
173 "data": "PT36H",
174 "valid": true,
175 "skip": {
176 "v3-roundtrip": "could not extract schema"
177 }
178 },
179 {
180 "description": "one and a half days, in days and hours",
181 "data": "P1DT12H",
182 "valid": true,
183 "skip": {
184 "v3-roundtrip": "could not extract schema"
185 }
186 },
187 {
188 "description": "two weeks",
189 "data": "P2W",
190 "valid": true,
191 "skip": {
192 "v3-roundtrip": "could not extract schema"
193 }
194 },
195 {
196 "description": "weeks cannot be combined with other units",
197 "data": "P1Y2W",
198 "valid": false,
199 "skip": {
200 "v3": "unexpected success",
201 "v3-roundtrip": "could not extract schema"
202 }
203 },
204 {
205 "description": "invalid non-ASCII '২' (a Bengali 2)",
206 "data": "P২Y",
207 "valid": false,
208 "skip": {
209 "v3": "unexpected success",
210 "v3-roundtrip": "could not extract schema"
211 }
212 },
213 {
214 "description": "element without unit",
215 "data": "P1",
216 "valid": false,
217 "skip": {
218 "v3": "unexpected success",
219 "v3-roundtrip": "could not extract schema"
220 }
221 }
222 ]
223 }
224 ]