-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.yml
117 lines (117 loc) · 2.66 KB
/
api.yml
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
openapi: 3.0.1
info:
title: Dave Sag's Boilerplate API
description: A boilerplate API codebase
contact:
email: 'davesag@gmail.com'
license:
name: 'MIT License'
url: https://opensource.org/licenses/MIT
version: 1.0.0
servers:
- url: /api/v1
tags:
- name: root
description: Root level API paths
- name: v1
description: Version 1 API Paths
paths:
/:
get:
tags:
- root
servers:
- url: /
summary: Display API version information
operationId: versions
responses:
200:
description: Information about the available API Versions
content:
application/json:
schema:
$ref: '#/components/schemas/VersionResponse'
/ping:
get:
tags:
- root
servers:
- url: /
summary: Checks that the server is alive
operationId: ping
responses:
200:
description: 'Information about the server'
content:
application/json:
schema:
$ref: '#/components/schemas/PingResponse'
/hello/{name}:
get:
tags:
- v1
summary: Say hello to the name provided
operationId: v1/hello
parameters:
- in: path
name: name
description: 'The name to say hello to'
schema:
type: string
required: true
responses:
200:
description: 'Just says hello'
content:
application/json:
schema:
$ref: '#/components/schemas/HelloWorldResponse'
400:
description: 'Bad request —Invalid name supplied'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/snooze:
get:
tags:
- v1
summary: Just wait a bit
operationId: v1/snooze
responses:
200:
description: 'Okay'
components:
schemas:
PingResponse:
type: object
properties:
name:
type: string
description:
type: string
version:
type: string
uptime:
type: number
APIVersion:
type: object
properties:
version:
type: integer
description: The API's version number
path:
type: string
description: The relative path to the API
VersionResponse:
type: array
items:
$ref: '#/components/schemas/APIVersion'
HelloWorldResponse:
type: string
ErrorResponse:
type: object
properties:
error:
type: string
description: The error message