-
Notifications
You must be signed in to change notification settings - Fork 205
Expand file tree
/
Copy pathopenapi.yaml
More file actions
67 lines (65 loc) · 1.54 KB
/
openapi.yaml
File metadata and controls
67 lines (65 loc) · 1.54 KB
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
openapi: 3.1.0
info:
title: Test format validation
version: 1.0.0
paths:
/test:
get:
responses:
200:
description: Validate formats using $refs.
content:
application/json:
schema:
type: string
format: date-time
examples:
Correct:
$ref: '#/components/examples/DateTime'
Incorrect:
$ref: '#/components/examples/Date'
components:
schemas:
Date:
type: string
format: date
examples:
- '2000-01-01' # correct
- 2000 # incorrect type
- incorrect
Email:
description: Email address for ticket purchaser.
type: string
format: email
examples:
- museum-lover@example.com # correct
- wrong.format
Id:
type: string
format: uuid
examples:
- 3be6453c-03eb-4357-ae5a-984a0e574a54 # correct
- incorrect
- 42 # wrong type
Time:
type: string
pattern: '^([01]\d|2[0-3]):?([0-5]\d)$'
description: Time the museum opens on a specific date. Uses 24 hour time format (`HH:mm`).
examples:
- 09:00 # correct
- incorrect
- 09.00 # wrong type
Oneof:
type: string
oneOf:
- format: date
- pattern: ^(month|year)ly$
examples:
- '2000-01-01' # correct
- monthly # correct
- wrong
examples:
Date:
value: '2000-01-01'
DateTime:
value: '2000-01-01T12:00:00Z'