Skip to content

Commit d3c0096

Browse files
committed
encoding/openapi: update tests
Not sure why the Git CI didn't catch this. Change-Id: I1869cf3376f5caca52d5ccb68375e5dc03d6a8ea Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6441 Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent ecfbd72 commit d3c0096

File tree

10 files changed

+40
-82
lines changed

10 files changed

+40
-82
lines changed

encoding/openapi/testdata/builtins.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
"properties": {
1919
"timestamp1": {
2020
"type": "string",
21-
"format": "dateTime"
21+
"format": "date-time"
2222
},
2323
"timestamp2": {
2424
"type": "string",
25-
"format": "dateTime"
25+
"format": "date-time"
2626
},
2727
"timestamp3": {
2828
"type": "string",
29-
"format": "dateTime"
29+
"format": "date-time"
3030
},
3131
"timestamp4": {
3232
"type": "string",
33-
"format": "dateTime"
33+
"format": "date-time"
3434
},
3535
"date1": {
3636
"type": "string",

encoding/openapi/testdata/oneof-funcs.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@
281281
"properties": {
282282
"exact": {
283283
"description": "Randomly picked description from a set of size one.",
284-
"type": "string",
285-
"format": "string"
284+
"type": "string"
286285
}
287286
}
288287
},
@@ -293,8 +292,7 @@
293292
"properties": {
294293
"regex": {
295294
"description": "Randomly picked description from a set of size one.",
296-
"type": "string",
297-
"format": "string"
295+
"type": "string"
298296
}
299297
}
300298
}
@@ -308,8 +306,7 @@
308306
"properties": {
309307
"exact": {
310308
"description": "Randomly picked description from a set of size one.",
311-
"type": "string",
312-
"format": "string"
309+
"type": "string"
313310
}
314311
}
315312
},
@@ -320,8 +317,7 @@
320317
"properties": {
321318
"regex": {
322319
"description": "Randomly picked description from a set of size one.",
323-
"type": "string",
324-
"format": "string"
320+
"type": "string"
325321
}
326322
}
327323
}
@@ -488,8 +484,7 @@
488484
"properties": {
489485
"shared": {
490486
"description": "Randomly picked description from a set of size one.",
491-
"type": "string",
492-
"format": "string"
487+
"type": "string"
493488
},
494489
"extra": {
495490
"description": "Randomly picked description from a set of size one.",

encoding/openapi/testdata/oneof-resolve.json

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,10 @@
134134
"type": "integer"
135135
},
136136
"exact": {
137-
"type": "string",
138-
"format": "string"
137+
"type": "string"
139138
},
140139
"regex": {
141-
"type": "string",
142-
"format": "string"
140+
"type": "string"
143141
}
144142
},
145143
"allOf": [
@@ -229,12 +227,10 @@
229227
"type": "integer"
230228
},
231229
"exact": {
232-
"type": "string",
233-
"format": "string"
230+
"type": "string"
234231
},
235232
"regex": {
236-
"type": "string",
237-
"format": "string"
233+
"type": "string"
238234
}
239235
},
240236
"allOf": [
@@ -383,12 +379,10 @@
383379
"type": "integer"
384380
},
385381
"exact": {
386-
"type": "string",
387-
"format": "string"
382+
"type": "string"
388383
},
389384
"regex": {
390-
"type": "string",
391-
"format": "string"
385+
"type": "string"
392386
}
393387
},
394388
"allOf": [
@@ -463,13 +457,7 @@
463457
"WithMap": {
464458
"type": "object",
465459
"properties": {
466-
"shared": {
467-
"type": "object",
468-
"format": "string",
469-
"additionalProperties": {
470-
"type": "integer"
471-
}
472-
},
460+
"shared": {},
473461
"extra": {
474462
"type": "integer"
475463
}

encoding/openapi/testdata/oneof.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@
256256
],
257257
"properties": {
258258
"exact": {
259-
"type": "string",
260-
"format": "string"
259+
"type": "string"
261260
}
262261
}
263262
},
@@ -267,8 +266,7 @@
267266
],
268267
"properties": {
269268
"regex": {
270-
"type": "string",
271-
"format": "string"
269+
"type": "string"
272270
}
273271
}
274272
}
@@ -281,8 +279,7 @@
281279
],
282280
"properties": {
283281
"exact": {
284-
"type": "string",
285-
"format": "string"
282+
"type": "string"
286283
}
287284
}
288285
},
@@ -292,8 +289,7 @@
292289
],
293290
"properties": {
294291
"regex": {
295-
"type": "string",
296-
"format": "string"
292+
"type": "string"
297293
}
298294
}
299295
}
@@ -444,8 +440,7 @@
444440
],
445441
"properties": {
446442
"shared": {
447-
"type": "string",
448-
"format": "string"
443+
"type": "string"
449444
},
450445
"extra": {
451446
"type": "integer"

encoding/openapi/testdata/openapi-norefs.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@
6565
"type": "number"
6666
},
6767
"a": {
68-
"type": "string",
69-
"format": "string"
68+
"type": "string"
7069
}
7170
},
7271
"oneOf": [
@@ -118,8 +117,7 @@
118117
"bar": {
119118
"type": "array",
120119
"items": {
121-
"type": "string",
122-
"format": "string"
120+
"type": "string"
123121
}
124122
},
125123
"a": {
@@ -130,8 +128,7 @@
130128
]
131129
},
132130
"b": {
133-
"type": "string",
134-
"format": "string"
131+
"type": "string"
135132
}
136133
},
137134
"oneOf": [
@@ -169,12 +166,9 @@
169166
"type": "object",
170167
"properties": {
171168
"a": {
172-
"type": "string",
173-
"format": "string"
169+
"type": "string"
174170
},
175-
"b": {
176-
"format": "string"
177-
}
171+
"b": {}
178172
},
179173
"oneOf": [
180174
{

encoding/openapi/testdata/openapi.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@
7777
],
7878
"properties": {
7979
"a": {
80-
"type": "string",
81-
"format": "string"
80+
"type": "string"
8281
}
8382
}
8483
}
@@ -113,8 +112,7 @@
113112
"bar": {
114113
"type": "array",
115114
"items": {
116-
"type": "string",
117-
"format": "string"
115+
"type": "string"
118116
}
119117
}
120118
},
@@ -139,8 +137,7 @@
139137
],
140138
"properties": {
141139
"b": {
142-
"type": "string",
143-
"format": "string"
140+
"type": "string"
144141
}
145142
}
146143
}
@@ -168,8 +165,7 @@
168165
"type": "object",
169166
"properties": {
170167
"a": {
171-
"type": "string",
172-
"format": "string"
168+
"type": "string"
173169
}
174170
},
175171
"oneOf": [
@@ -189,8 +185,7 @@
189185
],
190186
"properties": {
191187
"b": {
192-
"type": "string",
193-
"format": "string"
188+
"type": "string"
194189
}
195190
}
196191
},

encoding/openapi/testdata/refs.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
],
1515
"properties": {
1616
"b": {
17-
"type": "string",
18-
"format": "string"
17+
"type": "string"
1918
}
2019
}
2120
},
@@ -47,8 +46,7 @@
4746
"type": "object",
4847
"properties": {
4948
"a": {
50-
"type": "string",
51-
"format": "string"
49+
"type": "string"
5250
}
5351
},
5452
"allOf": [

encoding/openapi/testdata/simple-filter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
},
3535
"deprecatedField": {
3636
"type": "string",
37-
"format": "string",
3837
"deprecated": true
3938
}
4039
}

encoding/openapi/testdata/simple.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
},
3737
"deprecatedField": {
3838
"type": "string",
39-
"format": "string",
4039
"deprecated": true
4140
}
4241
}

encoding/openapi/testdata/structural.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"properties": {
1414
"stringValue": {
1515
"description": "Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI",
16-
"type": "string",
17-
"format": "string"
16+
"type": "string"
1817
},
1918
"int64Value": {
2019
"description": "Used for values of type INT64",
@@ -38,7 +37,7 @@
3837
"timestampValue": {
3938
"description": "Used for values of type TIMESTAMP",
4039
"type": "string",
41-
"format": "dateTime"
40+
"format": "date-time"
4241
},
4342
"durationValue": {
4443
"description": "Used for values of type DURATION",
@@ -55,8 +54,7 @@
5554
"description": "Holds a set of name/value pairs.",
5655
"type": "object",
5756
"additionalProperties": {
58-
"type": "string",
59-
"format": "string"
57+
"type": "string"
6058
}
6159
}
6260
}
@@ -119,8 +117,7 @@
119117
"properties": {
120118
"stringValue": {
121119
"description": "Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI",
122-
"type": "string",
123-
"format": "string"
120+
"type": "string"
124121
},
125122
"int64Value": {
126123
"description": "Used for values of type INT64",
@@ -144,7 +141,7 @@
144141
"timestampValue": {
145142
"description": "Used for values of type TIMESTAMP",
146143
"type": "string",
147-
"format": "dateTime"
144+
"format": "date-time"
148145
},
149146
"durationValue": {
150147
"description": "Used for values of type DURATION",
@@ -161,8 +158,7 @@
161158
"description": "Holds a set of name/value pairs.",
162159
"type": "object",
163160
"additionalProperties": {
164-
"type": "string",
165-
"format": "string"
161+
"type": "string"
166162
}
167163
}
168164
}
@@ -224,8 +220,7 @@
224220
"description": "Holds a set of name/value pairs.",
225221
"type": "object",
226222
"additionalProperties": {
227-
"type": "string",
228-
"format": "string"
223+
"type": "string"
229224
}
230225
}
231226
}

0 commit comments

Comments
 (0)