-
Notifications
You must be signed in to change notification settings - Fork 13
/
openapi-example.yaml
118 lines (114 loc) · 2.92 KB
/
openapi-example.yaml
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
openapi: 3.0.3
info:
version: 1.0.0
title: Sample API
description: A sample API to illustrate OpenAPI concepts
paths:
/:
get:
description: the root
responses:
default:
description: root
content:
text/plain:
schema:
type: string
examples:
root:
value: This is the root.
/count:
get:
description: outputs the number of time each URL was visited
responses:
default:
description: Successful response
content:
application/json:
schema:
type: string
examples:
no visits:
value: You have not visited anyone yet
/hello/kitty:
get:
description: HTML with a hello kitty image
responses:
default:
description: Successful response
content:
application/json:
schema:
type: string
examples:
hello kitty:
value: >-
<img
src="https://upload.wikimedia.org/wikipedia/en/0/05/Hello_kitty_character_portrait.png">
/hello/{name}:
get:
parameters:
- in: path
name: name
required: true
schema:
type: string
description: says hello to the name
description: says hello to someone
responses:
default:
description: Successful response
headers:
x-test:
schema:
type: string
content:
application/json:
schema:
type: string
example: an example string
examples:
hello-example1:
value: Hello, example1
hello-example2:
value: Hello, example2
/path-one:
get:
responses:
"200":
description: test
content:
application/json:
schema:
$ref: "#/components/schemas/Recursive"
"400":
$ref: "#/components/responses/BadRequest"
components:
responses:
BadRequest:
description: The request is malformed and so cannot be processed
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
schemas:
Error:
title: Error
description: A generic error message suitable for 4xx and 5xx responses
type: object
properties:
code:
type: string
description: A machine readable error code
message:
type: string
description: A detailed description of the error
required:
- message
Recursive:
oneOf:
- { $ref: "#/components/schemas/Recursive" }
securitySchemes:
basicAuth:
type: http
scheme: basic