-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbump.openapi.v3.yml
212 lines (207 loc) · 7.82 KB
/
bump.openapi.v3.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
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
openapi: "3.0.2"
info:
title: Bump Api
description: >
This is the official Bump API documentation. Obviously created with Bump.
version: "1.0"
servers:
- url: https://bump.sh/api/v1
x-topics:
- title: Authentication
content: |
# Api token authentication
Use the token from your documentation settings as the username of the basic auth, with no password.
Example: `curl https://bump.sh/api/v1/docs/1/versions -u DOC_TOKEN:`
Note that adding a colon after your token prevents cURL from asking for a password.
paths:
/versions:
post:
summary: Create a new version
description: >
Deploy a new version for a given documentation, which will become the current version.
requestBody:
$ref: "#/components/requestBodies/Version"
responses:
"200":
description: "Success"
"422":
$ref: "#/components/responses/InvalidDefinition"
/validations:
post:
summary: Validate a documentation definition
description: >
Validate a definition against its schema (OpenAPI or AsyncAPI) and return errors without
creating a new version. This is useful in a CI process, to validate that a changed
definition file is valid and won't fail when being deployed on Bump.
requestBody:
$ref: "#/components/requestBodies/Version"
responses:
"200":
description: "Success"
"422":
$ref: "#/components/responses/InvalidDefinition"
/previews:
post:
summary: Create a preview
description: >
Create a preview for a given documentation file. The preview will have a unique
temporary URL, and will be active for 30 minutes.
requestBody:
$ref: "#/components/requestBodies/Preview"
responses:
"200":
description: "Success"
content:
"application/json":
schema:
$ref: "#/components/schemas/Preview"
"422":
$ref: "#/components/responses/InvalidDefinition"
/ping:
get:
summary: Check the API status
description: Responds a pong if the API is up and running.
responses:
"200":
description: "Success"
content:
"application/json":
schema:
$ref: "#/components/schemas/Pong"
default:
description: API is currently down
components:
requestBodies:
Preview:
description: The version object
content:
"application/json":
schema:
required:
- definition
properties:
definition:
type: string
description: >
Serialized definition of the version. This should be an OpenAPI 2.x, 3.x or AsyncAPI 2.x file
serialized as a string, in YAML or JSON.
example: |
{asyncapi: "2.0", "info": { "title: ... }}
specification:
type: string
description: 'Specification for the definition, as a path: `speficiation_name/specification_version/format`. Example: `openapi/v2/yaml`.'
enum:
- openapi/v2/yaml
- openapi/v2/json
- openapi/v3/yaml
- openapi/v3/json
example: openapi/v2/yaml
validation:
type: string
description: |
Validation strategy:
- `basic`: basic validation (default)
- `strict`: validate the file against its specification
references:
type: array
description: Import external references used by `definition`. It's usually resources not accessible by Bump servers, like local files or internal URLs.
items:
$ref: "#/components/schemas/Reference"
Version:
description: The version object
content:
"application/json":
schema:
required:
- definition
properties:
documentation_id:
type: string
description: UUID of the documentation. Required if `documentation_slug` is empty.
documentation_slug:
type: string
description: Slug of the documentation. Required if `documentation_id` is empty.
hub_id:
type: string
description: UUID of the hub if the documentation is part of a hub.
hub_slug:
type: string
description: Slug of the hub if the documentation is part of a hub.
auto_create_documentation:
type: boolean
default: false
description: Create the documentation if not existing yet. Must be used with a `hub_id` or `hub_slug`, and a `documentation_slug`.
definition:
type: string
description: >
Serialized definition of the version. This should be an OpenAPI 2.x, 3.x or AsyncAPI 2.x file
serialized as a string, in YAML or JSON.
example: |
{openapi: "3.0", "info": { "title: ... }}
specification:
type: string
description: 'Specification for the definition, as a path: `speficiation_name/specification_version/format`. Example: `openapi/v2/yaml`.'
enum:
- openapi/v2/yaml
- openapi/v2/json
- openapi/v3/yaml
- openapi/v3/json
example: openapi/v2/yaml
validation:
type: string
description: |
Validation strategy:
- `basic`: basic validation (default)
- `strict`: validate the file against its specification
references:
type: array
description: Import external references used by `definition`. It's usually resources not accessible by Bump servers, like local files or internal URLs.
items:
$ref: "#/components/schemas/Reference"
responses:
"InvalidDefinition":
description: Definition is not valid.
content:
"application/json":
schema:
$ref: "#/components/schemas/Error"
schemas:
Reference:
type: object
properties:
location:
type: string
description: Location of the external reference as it's called from `definition`, without the relative path (the part after `#/`). Can be an URL of a file system path.
example: https://example.com/api/models/pet.yml
content:
type: string
description: Content of the external reference, as a string.
Error:
properties:
message:
type: string
description: Human readable error message.
example: Invalid definition file
errors:
type: object
description: Hash of invalid attributes with their error messages.
example:
raw_definition:
- The property '#/paths//docs/{:id}/validations/post' contains additional properties ["yolo"] outside of the schema when none are allowed
Pong:
properties:
pong:
type: string
description: Sentence about ping and pong
example: And that's how ping-pong ball is bumped
Preview:
properties:
id:
type: string
description: "Unique id for the preview URL: `https://bump.sh/preview/:id`."
example: 3ef8f52f-9056-4113-840e-2f7183b90e06
expires_at:
type: string
format: date-time
description: Preview expiration date and time.
example: 2010-04-14T17:05:00+01:00