-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswagger.yaml
144 lines (131 loc) · 3.59 KB
/
swagger.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
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
swagger: '2.0'
info:
version: 1.0.0
title: API Focus - Example API
description: A simple example API for the API Focus Project.
consumes:
- application/json
produces:
- application/json
tags:
- name: no auth
description: No authentication is required for these endpoints.
- name: auth required
description: |
Authentication is required for these endpoints. A device must pass a valid ApiKey header.
paths:
/:
get:
tags:
- no auth
summary: API Ping
description: "This endpoint is used to verify the server is available."
x-swagger-router-controller: IndexController
operationId: indexGet
responses:
"200":
description: "**OK**: The server is up."
/echo:
post:
tags:
- no auth
summary: Echo Reply
description: |
Replies with whatever body is passed into the post.
x-swagger-router-controller: EchoController
operationId: echoPost
parameters:
- in: body
name: EchoRequest
required: true
schema:
$ref: '#/definitions/EchoRequest'
responses:
'200':
description: |
**OK**: It worked!
schema:
$ref: '#/definitions/EchoResponse'
'400':
description: |
**Bad Request**: Indicates some issue with the call, likely the request
fails parsing or validation.
'501':
description: |
**Not Implemented**: Indicates the endpoint does not have a matching
controller. Returns an HTML formatted error with further details.
/echo_secured:
post:
tags:
- auth required
summary: Echo Reply
description: |
Replies with whatever body is passed into the post.
security:
- ApiKeyAuth: []
x-swagger-router-controller: EchoSecuredController
operationId: echoSecuredPost
parameters:
- in: body
name: EchoRequest
required: true
schema:
$ref: '#/definitions/EchoRequest'
responses:
'200':
description: |
**OK**: It worked!
schema:
$ref: '#/definitions/EchoResponse'
'400':
description: |
**Bad Request**: Indicates some issue with the call, likely the request
fails parsing or validation.
'501':
description: |
**Not Implemented**: Indicates the endpoint does not have a matching
controller. Returns an HTML formatted error with further details.
securityDefinitions:
ApiKeyAuth:
type: apiKey
in: header
name: apikey
definitions:
EchoRequest:
description: |
This schema is used to format the Echo request body.
type: object
required:
- echoMessage
properties:
echoMessage:
description: |
The message to Echo.
type: string
outputTimestamp:
description: |
A boolean to indicate whether the echo should include a
timestamp when it responds.
type: boolean
default: false
example:
echoMessage: Hi there.
outputTimestamp: true
EchoResponse:
description: |
This schema is used to format the Echo response body.
type: object
required:
- echoMessage
properties:
echoMessage:
description: |
The message Echo.
type: string
timestamp:
description: |
The timestamp for the echo.
type: integer
example:
echoMessage: Hi there.
timestamp: 1618961900