File: fixture-all-formats.yaml

package info (click to toggle)
golang-github-go-openapi-validate 0.24.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,040 kB
  • sloc: sh: 11; makefile: 6
file content (593 lines) | stat: -rw-r--r-- 14,258 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
---
swagger: '2.0'
info:
  title: 'fixture to tests formats in parameters, schema objects'
  version: '1.0'
  description: |
    This exercises the type and format validation based on complete spec
produces:
  - application/json
paths:
  /fixture/formats-good:
    get:
      operationId: op1
      parameters:
        - name: p01
          in: query
          type: string
          format: byte
          default: 'ZWxpemFiZXRocG9zZXk='
        - name: p02
          in: query
          type: string
          format: creditcard
          default: '4111-1111-1111-1111'
        - name: p03
          in: query
          type: string
          format: date
          default: 1970-01-01
        - name: p04
          in: query
          type: string
          format: date-time
          default: '1963-06-19T08:30:06.283185Z'
        - name: p05
          in: query
          type: string
          format: duration
          default: '3 weeks'
        - name: p06
          in: query
          type: string
          format: email
          default: 'joe.bloggs@example.com'
        - name: p07
          in: query
          type: string
          format: hexcolor
          default: '#FFFFFF'
        - name: p08
          in: query
          type: string
          format: hostname
          default: 'www.example.com'
        - name: p09
          in: query
          type: string
          format: ipv4
          default: '192.168.0.1'
        - name: p10
          in: query
          type: string
          format: ipv6
          default:  '::1'
        - name: p11
          in: query
          type: string
          format: isbn
          default: '0321751043'
        - name: p12
          in: query
          type: string
          format: isbn10
          default: '0321751043'
        - name: p13
          in: query
          type: string
          format: isbn13
          default: '978 3401013190'
        - name: p14
          in: query
          type: string
          format: mac
          default: '01:02:03:04:05:06'
        - name: p15
          in: query
          type: string
          format: bsonobjectid
          default: '507f1f77bcf86cd799439011'
        - name: p16
          in: query
          type: string
          format: password
          default: 'secret'
        - name: p17
          in: query
          type: string
          format: rgbcolor
          default: 'rgb(100,100,100)'
        - name: p18
          in: query
          type: string
          format: ssn
          default: '111-11-1111'
        - name: p19
          in: query
          type: string
          format: uri
          default: 'http://foo.bar/?baz=qux#quux'
        - name: p20
          in: query
          type: string
          format: uuid
          default: 'a8098c1a-f86e-11da-bd1a-00112444be1e'
        - name: p21
          in: query
          type: string
          format: uuid3
          default: 'bcd02e22-68f0-3046-a512-327cca9def8f'
        - name: p22
          in: query
          type: string
          format: uuid4
          default: '025b0d74-00a2-4048-bf57-227c5111bb34'
        - name: p23
          in: query
          type: string
          format: uuid5
          default: '886313e1-3b8a-5372-9b90-0c9aee199e5d'
        - name: n01
          in: query
          type: number
          format: float
          default: 10.01
        - name: n02
          in: query
          type: number
          format: double
          default: 100.99
        - name: n03
          in: query
          type: integer
          format: int32
          default: -12
        - name: n04
          in: query
          type: integer
          format: int64
          default: 20
        - name: n05
          in: query
          type: integer
          format: uint32
          default: 20
        - name: n06
          in: query
          type: integer
          format: uint64
          default: 30
          # TODO: check format aliases
      responses:
        200:
          description: 'response exercising formats'
          # TODO: check format in headers
          schema:
            $ref: '#/definitions/allformats'

  /fixture/formats-bad:
    get:
      operationId: op2
      parameters:
        - name: p01
          in: query
          type: string
          format: byte
          default: 'ZWxpemFiZXRocG9zZXk'
        - name: p02
          in: query
          type: string
          format: creditcard
          default: '4111-1X11-1111-1111'
        - name: p03
          in: query
          type: string
          format: date
          default: 1970-13-01
        - name: p04
          in: query
          type: string
          format: date-time
          default: '1963-13-19T08:30:06.283185Z'
        - name: p05
          in: query
          type: string
          format: duration
          default: 'three weeks'
        - name: p06
          in: query
          type: string
          format: email
          default: 'joe.bloggs-example.com'
        - name: p07
          in: query
          type: string
          format: hexcolor
          default: 'xFFFFFF'
        - name: p08
          in: query
          type: string
          format: hostname
          default: 'not_a_valid_hostname'
        - name: p09
          in: query
          type: string
          format: ipv4
          default: '192.168.0.256'
        - name: p10
          in: query
          type: string
          format: ipv6
          default:  'o::1'
        - name: p11
          in: query
          type: string
          format: isbn
          default: 'abc-0321751043'
        - name: p12
          in: query
          type: string
          format: isbn10
          default: 'abc-0321751043'
        - name: p13
          in: query
          type: string
          format: isbn13
          default: '978|3401013190'
        - name: p14
          in: query
          type: string
          format: mac
          default: '01:02:03:04:05:06:07'
        - name: p15
          in: query
          type: string
          format: bsonobjectid
          default: 'x07f1f77bcf86cd799439011'
        - name: p16
          in: query
          type: string
          format: password
          default: 0
        - name: p17
          in: query
          type: string
          format: rgbcolor
          default: 'rgb(100,100)'
        - name: p18
          in: query
          type: string
          format: ssn
          default: '111-11111'
        - name: p19
          in: query
          type: string
          format: uri
          default: 'httz://foo.bar/?baz=qux#quux'
        - name: p20
          in: query
          type: string
          format: uuid
          default: 'a8098c1a+f86e+11da+bd1a+00112444be1e'
        - name: p21
          in: query
          type: string
          format: uuid3
          default: 'bcd02e22+68f0+3046+a512+327cca9def8f'
        - name: p22
          in: query
          type: string
          format: uuid4
          default: '025b0d74+00a2+4048+bf57+227c5111bb34'
        - name: p23
          in: query
          type: string
          format: uuid5
          default: '886313e1+3b8a+5372+9b90+0c9aee199e5d'
        - name: n01
          in: query
          type: number
          format: float
          default: abc
        - name: n02
          in: query
          type: number
          format: double
          default: 100.99
        - name: n03
          in: query
          type: integer
          format: int32
          default: -12.05
        - name: n04
          in: query
          type: integer
          format: int64
          default: 20.05
        - name: n05
          in: query
          type: integer
          format: uint32
          default: -20
        - name: n06
          in: query
          type: integer
          format: uint64
          default: -30
      responses:
        200:
          description: 'response exercising formats'
          schema:
            $ref: '#/definitions/allformats-bad'
 
  /fixture/body:
    post:
      operationId: op3
      parameters:
        - name: allformat
          in: body
          schema:
            $ref: '#/definitions/allformats'
      responses:
        200:
          description: 'response exercising formats'
          # TODO: check format in headers
          schema:
            $ref: '#/definitions/allformats'
  /fixture/file:
    post:
      operationId: op4
      consumes: 
      - multipart/form-data
      parameters:
        - name: f01
          in: formData
          type: file
          required: true
        - name: f02
          in: formData
          type: file
          required: false
      responses:
        200:
          description: 'response exercising formats'

definitions:
  allformats:
    type: object
    properties:
      prop01:
        type: string
        format: byte
        default: 'ZWxpemFiZXRocG9zZXk='
      prop02:
        type: string
        format: creditcard
        default: '4111-1111-1111-1111'
      prop03:
        type: string
        format: date
        default: 1970-01-01
      prop04:
        type: string
        format: date-time
        default: '1963-06-19T08:30:06.283185Z'
      prop05:
        type: string
        format: duration
        default: '3 weeks'
      prop06:
        type: string
        format: email
        default: 'joe.bloggs@example.com'
      prop07:
        type: string
        format: hexcolor
        default: '#FFFFFF'
      prop08:
        type: string
        format: hostname
        default: 'www.example.com'
      prop09:
        type: string
        format: ipv4
        default: '192.168.0.1'
      prop10:
        type: string
        format: ipv6
        default:  '::1'
      prop11:
        type: string
        format: isbn
        default: '0321751043'
      prop12:
        type: string
        format: isbn10
        default: '0321751043'
      prop13:
        type: string
        format: isbn13
        default: '978 3401013190'
      prop14:
        type: string
        format: mac
        default: '01:02:03:04:05:06'
      prop15:
        type: string
        format: bsonobjectid
        default: '507f1f77bcf86cd799439011'
      prop16:
        type: string
        format: password
        default: 'secret'
      prop17:
        type: string
        format: rgbcolor
        default: 'rgb(100,100,100)'
      prop18:
        type: string
        format: ssn
        default: '111-11-1111'
      prop19:
        type: string
        format: uri
        default: 'http://foo.bar/?baz=qux#quux'
      prop20:
        type: string
        format: uuid
        default: 'a8098c1a-f86e-11da-bd1a-00112444be1e'
      prop21:
        type: string
        format: uuid3
        default: 'bcd02e22-68f0-3046-a512-327cca9def8f'
      prop22:
        type: string
        format: uuid4
        default: '025b0d74-00a2-4048-bf57-227c5111bb34'
      prop23:
        type: string
        format: uuid5
        default: '886313e1-3b8a-5372-9b90-0c9aee199e5d'
      propn01:
        type: number
        format: float
        default: 10.01
      propn02:
        type: number
        format: double
        default: 100.99
      propn03:
        type: integer
        format: int32
        default: -12
      propn04:
        type: integer
        format: int64
        default: 20
      propn05:
        type: integer
        format: uint32
        default: 20
      propn06:
        type: integer
        format: uint64
        default: 30
  allformats-bad:
    type: object
    properties:
      prop01:
        type: string
        format: byte
        default: 'ZWxpemFiZXRocG9zZXk'
      prop02:
        type: string
        format: creditcard
        default: '4111-1111-1111-111K'
      prop03:
        type: string
        format: date
        default: 1970-01-32
      prop04:
        type: string
        format: date-time
        default: '1963-06-19T99:30:06.283185Z'
      prop05:
        type: string
        format: duration
        default: 'weeks'
      prop06:
        type: string
        format: email
        default: 'joe.bloggs-example.com'
      prop07:
        type: string
        format: hexcolor
        default: 1
      prop08:
        type: string
        format: hostname
        default: '---invalid-hostname---'
      prop09:
        type: string
        format: ipv4
        default: '192.2.0.1.45'
      prop10:
        type: string
        format: ipv6
        default:  'x::1'
      prop11:
        type: string
        format: isbn
        default: 'X0321751043'
      prop12:
        type: string
        format: isbn10
        default: 'X0321751043'
      prop13:
        type: string
        format: isbn13
        default: 'X978 3401013190'
      prop14:
        type: string
        format: mac
        default: 'X1:02:03:04:05:06'
      prop15:
        type: string
        format: bsonobjectid
        default: 'X507f1f77bcf86cd799439011'
      prop16:
        type: string
        format: password
        default: 10
      prop17:
        type: string
        format: rgbcolor
        default: 'gb(100,100,100)'
      prop18:
        type: string
        format: ssn
        default: 'Z111-11-1111'
      prop19:
        type: string
        format: uri
        default: 'xttp://foo.bar/?baz=qux#quux'
      prop20:
        type: string
        format: uuid
        default: 'a8098c1a+f86e+11da+bd1a+00112444be1e'
      prop21:
        type: string
        format: uuid3
        default: 'bcd02e22+68f0+3046+a512+327cca9def8f'
      prop22:
        type: string
        format: uuid4
        default: '025b0d74+00a2+4048+bf57+227c5111bb34'
      prop23:
        type: string
        format: uuid5
        default: '886313e1+3b8a+5372+9b90+0c9aee199e5d'
      propn01:
        type: number
        format: float
        default: abc
      propn02:
        type: number
        format: double
        default: abc
      propn03:
        type: integer
        format: int32
        default: -12.05
      propn04:
        type: integer
        format: int64
        default: 20.99
      propn05:
        type: integer
        format: uint32
        default: 20.05
      propn06:
        type: integer
        format: uint64
        default: 30.05