prettyopenapi 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- prettyopenapi/__init__.py +183 -0
- prettyopenapi/_ui/assets/index-BhiQ8oHd.js +147 -0
- prettyopenapi/_ui/assets/index-PWCwrI2V.css +2 -0
- prettyopenapi/_ui/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- prettyopenapi/_ui/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
- prettyopenapi/_ui/assets/manrope-cyrillic-wght-normal-Dvxsihut.woff2 +0 -0
- prettyopenapi/_ui/assets/manrope-greek-wght-normal-DL7QRZyv.woff2 +0 -0
- prettyopenapi/_ui/assets/manrope-latin-ext-wght-normal-Ch3YOpNY.woff2 +0 -0
- prettyopenapi/_ui/assets/manrope-latin-wght-normal-DHIcAJRg.woff2 +0 -0
- prettyopenapi/_ui/assets/manrope-vietnamese-wght-normal-usUDDRr7.woff2 +0 -0
- prettyopenapi/_ui/assets/spec-Desh2iqS.js +320 -0
- prettyopenapi/_ui/index.html +34 -0
- prettyopenapi/py.typed +0 -0
- prettyopenapi-0.1.0.dist-info/METADATA +119 -0
- prettyopenapi-0.1.0.dist-info/RECORD +35 -0
- prettyopenapi-0.1.0.dist-info/WHEEL +5 -0
- prettyopenapi-0.1.0.dist-info/licenses/LICENSE +202 -0
- prettyopenapi-0.1.0.dist-info/licenses/THIRD_PARTY_LICENSES.md +2680 -0
- prettyopenapi-0.1.0.dist-info/top_level.txt +1 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
var e=`openapi: 3.0.3
|
|
2
|
+
info:
|
|
3
|
+
title: Posts API
|
|
4
|
+
version: 1.1.0
|
|
5
|
+
description: |
|
|
6
|
+
Demo API for the documentation builder. Posts run on the public
|
|
7
|
+
JSONPlaceholder service, files on httpbingo.org. Both accept any
|
|
8
|
+
credentials, so you can type anything into the authorization fields
|
|
9
|
+
and watch how it ends up in the request.
|
|
10
|
+
servers:
|
|
11
|
+
- url: https://jsonplaceholder.typicode.com
|
|
12
|
+
description: JSONPlaceholder
|
|
13
|
+
tags:
|
|
14
|
+
- name: Posts
|
|
15
|
+
description: Blog posts
|
|
16
|
+
- name: Files
|
|
17
|
+
description: Upload and download files
|
|
18
|
+
|
|
19
|
+
security:
|
|
20
|
+
- BearerAuth: []
|
|
21
|
+
|
|
22
|
+
paths:
|
|
23
|
+
/posts:
|
|
24
|
+
get:
|
|
25
|
+
tags: [Posts]
|
|
26
|
+
summary: List posts
|
|
27
|
+
description: Returns a list of posts. Results can be filtered by author, sorted and limited.
|
|
28
|
+
operationId: listPosts
|
|
29
|
+
security:
|
|
30
|
+
- ApiKeyAuth: []
|
|
31
|
+
- CookieAuth: []
|
|
32
|
+
parameters:
|
|
33
|
+
- name: userId
|
|
34
|
+
in: query
|
|
35
|
+
description: Return only posts written by this user.
|
|
36
|
+
schema:
|
|
37
|
+
type: integer
|
|
38
|
+
minimum: 1
|
|
39
|
+
maximum: 10
|
|
40
|
+
example: 1
|
|
41
|
+
- name: _sort
|
|
42
|
+
in: query
|
|
43
|
+
description: Field to sort by.
|
|
44
|
+
schema:
|
|
45
|
+
type: string
|
|
46
|
+
enum: [id, userId, title]
|
|
47
|
+
- name: _order
|
|
48
|
+
in: query
|
|
49
|
+
description: Sort direction. Used together with \`_sort\`.
|
|
50
|
+
schema:
|
|
51
|
+
type: string
|
|
52
|
+
enum: [asc, desc]
|
|
53
|
+
default: asc
|
|
54
|
+
- name: _limit
|
|
55
|
+
in: query
|
|
56
|
+
description: Maximum number of posts to return.
|
|
57
|
+
schema:
|
|
58
|
+
type: integer
|
|
59
|
+
minimum: 1
|
|
60
|
+
maximum: 100
|
|
61
|
+
example: 3
|
|
62
|
+
- name: If-None-Match
|
|
63
|
+
in: header
|
|
64
|
+
description: ETag from a previous response. If the list has not changed, the server answers 304 without a body.
|
|
65
|
+
schema:
|
|
66
|
+
type: string
|
|
67
|
+
- name: X-Request-Id
|
|
68
|
+
in: header
|
|
69
|
+
description: Optional ID that is echoed in server logs, helps when asking for support.
|
|
70
|
+
schema:
|
|
71
|
+
type: string
|
|
72
|
+
format: uuid
|
|
73
|
+
responses:
|
|
74
|
+
'200':
|
|
75
|
+
description: A list of posts.
|
|
76
|
+
content:
|
|
77
|
+
application/json:
|
|
78
|
+
schema:
|
|
79
|
+
type: array
|
|
80
|
+
items:
|
|
81
|
+
$ref: '#/components/schemas/Post'
|
|
82
|
+
'304':
|
|
83
|
+
description: The list has not changed since the ETag you sent. The body is empty, use your cached copy.
|
|
84
|
+
'400':
|
|
85
|
+
$ref: '#/components/responses/BadRequest'
|
|
86
|
+
'401':
|
|
87
|
+
$ref: '#/components/responses/Unauthorized'
|
|
88
|
+
'500':
|
|
89
|
+
$ref: '#/components/responses/ServerError'
|
|
90
|
+
|
|
91
|
+
post:
|
|
92
|
+
tags: [Posts]
|
|
93
|
+
summary: Create a post
|
|
94
|
+
description: Creates a new post. The server assigns the \`id\`.
|
|
95
|
+
operationId: createPost
|
|
96
|
+
requestBody:
|
|
97
|
+
required: true
|
|
98
|
+
content:
|
|
99
|
+
application/json:
|
|
100
|
+
schema:
|
|
101
|
+
$ref: '#/components/schemas/NewPost'
|
|
102
|
+
responses:
|
|
103
|
+
'201':
|
|
104
|
+
description: The post was created.
|
|
105
|
+
content:
|
|
106
|
+
application/json:
|
|
107
|
+
schema:
|
|
108
|
+
$ref: '#/components/schemas/Post'
|
|
109
|
+
'400':
|
|
110
|
+
$ref: '#/components/responses/BadRequest'
|
|
111
|
+
'401':
|
|
112
|
+
$ref: '#/components/responses/Unauthorized'
|
|
113
|
+
'500':
|
|
114
|
+
$ref: '#/components/responses/ServerError'
|
|
115
|
+
|
|
116
|
+
/anything/upload:
|
|
117
|
+
post:
|
|
118
|
+
tags: [Files]
|
|
119
|
+
summary: Upload a file
|
|
120
|
+
description: |
|
|
121
|
+
Uploads a file together with its metadata as \`multipart/form-data\`.
|
|
122
|
+
The demo server echoes back everything it received, including your
|
|
123
|
+
headers, so you can check what was really sent.
|
|
124
|
+
operationId: uploadFile
|
|
125
|
+
servers:
|
|
126
|
+
- url: https://httpbingo.org
|
|
127
|
+
description: httpbingo
|
|
128
|
+
requestBody:
|
|
129
|
+
required: true
|
|
130
|
+
content:
|
|
131
|
+
multipart/form-data:
|
|
132
|
+
schema:
|
|
133
|
+
type: object
|
|
134
|
+
required: [file]
|
|
135
|
+
properties:
|
|
136
|
+
file:
|
|
137
|
+
type: string
|
|
138
|
+
format: binary
|
|
139
|
+
description: The file to upload.
|
|
140
|
+
title:
|
|
141
|
+
type: string
|
|
142
|
+
description: Display name of the file.
|
|
143
|
+
maxLength: 80
|
|
144
|
+
example: Holiday photo
|
|
145
|
+
visibility:
|
|
146
|
+
type: string
|
|
147
|
+
description: Who can open the file.
|
|
148
|
+
enum: [private, public]
|
|
149
|
+
default: private
|
|
150
|
+
responses:
|
|
151
|
+
'200':
|
|
152
|
+
description: The file was received. The body echoes the request.
|
|
153
|
+
content:
|
|
154
|
+
application/json:
|
|
155
|
+
schema:
|
|
156
|
+
type: object
|
|
157
|
+
properties:
|
|
158
|
+
method:
|
|
159
|
+
type: string
|
|
160
|
+
description: HTTP method the server saw.
|
|
161
|
+
url:
|
|
162
|
+
type: string
|
|
163
|
+
description: Full URL the server saw.
|
|
164
|
+
form:
|
|
165
|
+
type: object
|
|
166
|
+
description: Text fields of the form, each as an array of values.
|
|
167
|
+
files:
|
|
168
|
+
type: object
|
|
169
|
+
description: Uploaded files, each as an array of file contents.
|
|
170
|
+
headers:
|
|
171
|
+
type: object
|
|
172
|
+
description: Request headers as the server saw them.
|
|
173
|
+
example:
|
|
174
|
+
method: POST
|
|
175
|
+
url: https://httpbingo.org/anything/upload
|
|
176
|
+
form:
|
|
177
|
+
title: [Holiday photo]
|
|
178
|
+
visibility: [private]
|
|
179
|
+
files:
|
|
180
|
+
file: ["data:image/png;base64,iVBORw0KGgo..."]
|
|
181
|
+
'401':
|
|
182
|
+
$ref: '#/components/responses/Unauthorized'
|
|
183
|
+
'500':
|
|
184
|
+
$ref: '#/components/responses/ServerError'
|
|
185
|
+
|
|
186
|
+
/image/{format}:
|
|
187
|
+
get:
|
|
188
|
+
tags: [Files]
|
|
189
|
+
summary: Download an image
|
|
190
|
+
description: Returns a sample image as a binary file. Use the download button next to the response.
|
|
191
|
+
operationId: downloadImage
|
|
192
|
+
servers:
|
|
193
|
+
- url: https://httpbingo.org
|
|
194
|
+
description: httpbingo
|
|
195
|
+
security: []
|
|
196
|
+
parameters:
|
|
197
|
+
- name: format
|
|
198
|
+
in: path
|
|
199
|
+
description: Image format.
|
|
200
|
+
schema:
|
|
201
|
+
type: string
|
|
202
|
+
enum: [png, jpeg, svg, webp]
|
|
203
|
+
responses:
|
|
204
|
+
'200':
|
|
205
|
+
description: The image file.
|
|
206
|
+
content:
|
|
207
|
+
image/png:
|
|
208
|
+
schema:
|
|
209
|
+
type: string
|
|
210
|
+
format: binary
|
|
211
|
+
image/jpeg:
|
|
212
|
+
schema:
|
|
213
|
+
type: string
|
|
214
|
+
format: binary
|
|
215
|
+
image/svg+xml:
|
|
216
|
+
schema:
|
|
217
|
+
type: string
|
|
218
|
+
format: binary
|
|
219
|
+
image/webp:
|
|
220
|
+
schema:
|
|
221
|
+
type: string
|
|
222
|
+
format: binary
|
|
223
|
+
'404':
|
|
224
|
+
description: The format is not supported.
|
|
225
|
+
content:
|
|
226
|
+
application/json:
|
|
227
|
+
schema:
|
|
228
|
+
$ref: '#/components/schemas/Error'
|
|
229
|
+
example:
|
|
230
|
+
code: not_found
|
|
231
|
+
message: Unsupported image format
|
|
232
|
+
|
|
233
|
+
components:
|
|
234
|
+
securitySchemes:
|
|
235
|
+
BearerAuth:
|
|
236
|
+
type: http
|
|
237
|
+
scheme: bearer
|
|
238
|
+
bearerFormat: JWT
|
|
239
|
+
description: Token from your account settings, sent as \`Authorization\`.
|
|
240
|
+
ApiKeyAuth:
|
|
241
|
+
type: apiKey
|
|
242
|
+
in: header
|
|
243
|
+
name: X-API-Key
|
|
244
|
+
description: Personal API key.
|
|
245
|
+
CookieAuth:
|
|
246
|
+
type: apiKey
|
|
247
|
+
in: cookie
|
|
248
|
+
name: session_id
|
|
249
|
+
description: Session cookie set after sign-in.
|
|
250
|
+
|
|
251
|
+
schemas:
|
|
252
|
+
NewPost:
|
|
253
|
+
type: object
|
|
254
|
+
required: [title, body, userId]
|
|
255
|
+
properties:
|
|
256
|
+
title:
|
|
257
|
+
type: string
|
|
258
|
+
description: Post headline.
|
|
259
|
+
minLength: 1
|
|
260
|
+
maxLength: 120
|
|
261
|
+
example: Hello, world
|
|
262
|
+
body:
|
|
263
|
+
type: string
|
|
264
|
+
description: Post text.
|
|
265
|
+
example: My first post.
|
|
266
|
+
userId:
|
|
267
|
+
type: integer
|
|
268
|
+
description: ID of the author.
|
|
269
|
+
minimum: 1
|
|
270
|
+
example: 1
|
|
271
|
+
Post:
|
|
272
|
+
allOf:
|
|
273
|
+
- $ref: '#/components/schemas/NewPost'
|
|
274
|
+
- type: object
|
|
275
|
+
required: [id]
|
|
276
|
+
properties:
|
|
277
|
+
id:
|
|
278
|
+
type: integer
|
|
279
|
+
description: Unique post ID, assigned by the server.
|
|
280
|
+
example: 101
|
|
281
|
+
Error:
|
|
282
|
+
type: object
|
|
283
|
+
required: [code, message]
|
|
284
|
+
properties:
|
|
285
|
+
code:
|
|
286
|
+
type: string
|
|
287
|
+
description: Machine-readable error code.
|
|
288
|
+
enum: [invalid_request, unauthorized, not_found, internal_error]
|
|
289
|
+
message:
|
|
290
|
+
type: string
|
|
291
|
+
description: Human-readable explanation.
|
|
292
|
+
responses:
|
|
293
|
+
BadRequest:
|
|
294
|
+
description: The request is malformed or a field failed validation.
|
|
295
|
+
content:
|
|
296
|
+
application/json:
|
|
297
|
+
schema:
|
|
298
|
+
$ref: '#/components/schemas/Error'
|
|
299
|
+
example:
|
|
300
|
+
code: invalid_request
|
|
301
|
+
message: "userId must be an integer"
|
|
302
|
+
Unauthorized:
|
|
303
|
+
description: Credentials are missing or invalid.
|
|
304
|
+
content:
|
|
305
|
+
application/json:
|
|
306
|
+
schema:
|
|
307
|
+
$ref: '#/components/schemas/Error'
|
|
308
|
+
example:
|
|
309
|
+
code: unauthorized
|
|
310
|
+
message: Invalid API key
|
|
311
|
+
ServerError:
|
|
312
|
+
description: Something went wrong on the server. Safe to retry.
|
|
313
|
+
content:
|
|
314
|
+
application/json:
|
|
315
|
+
schema:
|
|
316
|
+
$ref: '#/components/schemas/Error'
|
|
317
|
+
example:
|
|
318
|
+
code: internal_error
|
|
319
|
+
message: Unexpected error
|
|
320
|
+
`;export{e as default};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>API Builder</title>
|
|
7
|
+
<script>
|
|
8
|
+
// Restore the saved theme before first paint to avoid a flash. The palette colors live in CSS
|
|
9
|
+
// (data-palette); the mode (light/dark) is saved next to the id so no theme list is needed here.
|
|
10
|
+
try {
|
|
11
|
+
var id = localStorage.getItem('theme')
|
|
12
|
+
var mode = localStorage.getItem('theme-mode')
|
|
13
|
+
if (id === 'light') { id = 'flame'; mode = 'light' } // older versions saved just light/dark
|
|
14
|
+
if (id === 'dark') { id = 'midnight'; mode = 'dark' }
|
|
15
|
+
if (!id || (mode !== 'light' && mode !== 'dark')) {
|
|
16
|
+
// No saved choice: the host page may name a default theme (window.__API_BUILDER__.theme).
|
|
17
|
+
var dark = matchMedia('(prefers-color-scheme: dark)').matches
|
|
18
|
+
var cfg = window.__API_BUILDER__ && window.__API_BUILDER__.theme
|
|
19
|
+
id = typeof cfg === 'string' && /^[a-z]+$/.test(cfg) ? cfg : dark ? 'midnight' : 'flame'
|
|
20
|
+
mode = dark ? 'dark' : 'light' // initTheme() sets the right mode once it knows the theme list
|
|
21
|
+
}
|
|
22
|
+
var root = document.documentElement
|
|
23
|
+
root.setAttribute('data-palette', id)
|
|
24
|
+
root.setAttribute('data-theme', mode)
|
|
25
|
+
root.classList.add(mode)
|
|
26
|
+
} catch (e) {}
|
|
27
|
+
</script>
|
|
28
|
+
<script type="module" crossorigin src="./assets/index-BhiQ8oHd.js"></script>
|
|
29
|
+
<link rel="stylesheet" crossorigin href="./assets/index-PWCwrI2V.css">
|
|
30
|
+
</head>
|
|
31
|
+
<body class="bg-background text-foreground">
|
|
32
|
+
<div id="root"></div>
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
prettyopenapi/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prettyopenapi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A clean API documentation page for FastAPI: docs, code samples in cURL / Python / Node.js / Go and a Try it form, built from your OpenAPI document.
|
|
5
|
+
Author: laconal
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Keywords: openapi,swagger,fastapi,api-documentation,api-docs
|
|
8
|
+
Classifier: Framework :: FastAPI
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Typing :: Typed
|
|
12
|
+
Requires-Python: >=3.9
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
License-File: THIRD_PARTY_LICENSES.md
|
|
16
|
+
Requires-Dist: fastapi>=0.100
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# prettyopenapi
|
|
20
|
+
|
|
21
|
+
A clean API documentation page for **FastAPI**. It reads your OpenAPI document and shows the parameters,
|
|
22
|
+
fields, types, enums and errors, code samples (cURL, Python, Node.js, Go) and a **Try it** form that sends a real
|
|
23
|
+
request from the browser and shows what was actually sent as cURL.
|
|
24
|
+
|
|
25
|
+
FastAPI builds the document, this package serves the page. Python 3.9 or newer.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install prettyopenapi
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Use
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from fastapi import FastAPI
|
|
37
|
+
from prettyopenapi import setup_docs
|
|
38
|
+
|
|
39
|
+
app = FastAPI(docs_url=None) # turn off FastAPI's own Swagger UI, it uses the same /docs
|
|
40
|
+
|
|
41
|
+
# ... include your routers ...
|
|
42
|
+
|
|
43
|
+
setup_docs(app, "/docs")
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Open `http://localhost:8000/docs`. The document itself is at `/docs/openapi.json`.
|
|
47
|
+
Call `setup_docs` after the routers are included, so the path check sees every route.
|
|
48
|
+
|
|
49
|
+
Not for production? Register it conditionally:
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
import os
|
|
53
|
+
if os.getenv("ENV") != "production":
|
|
54
|
+
setup_docs(app, "/docs")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Next to Swagger UI
|
|
58
|
+
|
|
59
|
+
You can keep FastAPI's Swagger UI and put this page on another path:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
app = FastAPI() # Swagger UI stays at /docs
|
|
63
|
+
setup_docs(app, "/docs/v2") # this page: /docs/v2/
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If the path is already taken (for example `setup_docs(app, "/docs")` while Swagger UI is on), `setup_docs` raises
|
|
67
|
+
`PathConflictError` at startup and tells you what to change. Without the check the page would silently never be
|
|
68
|
+
reached, because the first matching route wins.
|
|
69
|
+
|
|
70
|
+
## `setup_docs()`
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
setup_docs(app, path="/docs", *, title=None, lang=None, theme=None, base_url=None)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
| Argument | Default | What it does |
|
|
77
|
+
| ---------- | ------- | ------------ |
|
|
78
|
+
| `app` | | The FastAPI application. |
|
|
79
|
+
| `path` | `"/docs"` | Where the page lives: `"docs"`, `"/docs"` and `"/docs/"` mean the same. |
|
|
80
|
+
| `title` | `info.title` of the document | The name in the sidebar and in the browser tab. |
|
|
81
|
+
| `lang` | the browser's language: Russian gives `"ru"`, anything else `"en"` | `"en"` or `"ru"`. The language the page opens in. |
|
|
82
|
+
| `theme` | follows the system: `flame` (light) or `midnight` (dark) | The theme the page opens in. An unknown name falls back to the default. |
|
|
83
|
+
| `base_url` | see below | The address **Try it** sends requests to. An absolute URL with `http://` or `https://`. |
|
|
84
|
+
|
|
85
|
+
What it serves (for `path="/docs"`):
|
|
86
|
+
|
|
87
|
+
| URL | What |
|
|
88
|
+
| -------------------- | ---- |
|
|
89
|
+
| `/docs` | Redirects to `docs/` (a relative redirect, so it works behind a proxy with a prefix). |
|
|
90
|
+
| `/docs/` | The documentation page. |
|
|
91
|
+
| `/docs/openapi.json` | The OpenAPI document of the application. |
|
|
92
|
+
| `/docs/assets/…` | The files of the page. |
|
|
93
|
+
|
|
94
|
+
These routes are left out of the OpenAPI document itself.
|
|
95
|
+
|
|
96
|
+
`lang` and `theme` are starting values. The reader can switch them on the page; that choice is saved in their
|
|
97
|
+
browser and wins from then on. Themes: light `flame`, `lavender`, `mint`, `serika`, `sky`; dark `midnight`,
|
|
98
|
+
`dracula`, `nord`, `gruvbox`, `catppuccin`.
|
|
99
|
+
|
|
100
|
+
### Where does Try it send requests?
|
|
101
|
+
|
|
102
|
+
1. `base_url`, if set. It replaces every `servers` entry of the document.
|
|
103
|
+
2. The `servers` of the document. Behind a proxy with `root_path` (`uvicorn --root-path /api`), FastAPI-style
|
|
104
|
+
`root_path` is added there, and a relative entry is resolved against the address of the document.
|
|
105
|
+
3. The address the docs page is served from. Right when the API and the docs live in one application.
|
|
106
|
+
|
|
107
|
+
## Notes
|
|
108
|
+
|
|
109
|
+
- Authorization values typed into **Try it** stay in the browser's memory and are not saved.
|
|
110
|
+
- Browsers do not allow a page to set the `Cookie` header. For a cookie scheme the browser sends the stored cookies
|
|
111
|
+
itself when the API is at the same address as the page and you are signed in.
|
|
112
|
+
- OAuth flows are not run: for oauth2 and OpenID Connect schemes, paste an access token you already have.
|
|
113
|
+
- Optional fields written the OpenAPI 3.1 way (`anyOf` with `null`), which is what FastAPI with Pydantic v2 emits,
|
|
114
|
+
are shown as ordinary optional fields.
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
Copyright 2026 laconal. Licensed under the Apache License, Version 2.0, see [LICENSE](LICENSE).
|
|
119
|
+
The licenses of the bundled third-party packages are in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
prettyopenapi/__init__.py,sha256=trljTHDtnpSJU-eye1c-IPLE6dcK5E7j8QorBml-2YI,7851
|
|
2
|
+
prettyopenapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
prettyopenapi/_ui/index.html,sha256=ToLP080CbUkJ8sbC5HuqpIiSeb27FHpWwnYiLKctXOY,1656
|
|
4
|
+
prettyopenapi/_ui/assets/index-BhiQ8oHd.js,sha256=9Um-nvzMTvYJ8KEpd2sHSNKn7GagxmTdg4tH4hZ55hk,739829
|
|
5
|
+
prettyopenapi/_ui/assets/index-PWCwrI2V.css,sha256=zUCp8b4lOkxELsxWO8GIM8cuJvDDvEuUO3ayA6WlG9g,518205
|
|
6
|
+
prettyopenapi/_ui/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2,sha256=Ui9YJzCBAqnA6nhgtaETBgQ2EOzwPRULoyBWoG6MVuI,5328
|
|
7
|
+
prettyopenapi/_ui/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff,sha256=Z8nMeGS0lA2_skbHtFLB3o6W8UDzNNNj_N2H2_6tq3I,6976
|
|
8
|
+
prettyopenapi/_ui/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff,sha256=ZYsiRrnQaLZMny2-p69PqhpYyUKGZK5VB6cwbzmZiVs,7020
|
|
9
|
+
prettyopenapi/_ui/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2,sha256=tFD5YKDSmEY3D8BQthg3J9IHWivLHFWVyZN0vwg7WoM,5384
|
|
10
|
+
prettyopenapi/_ui/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff,sha256=Cfieg2nXdFrF_pLmKp6hP2b0D9lbVJX6wBTFSzocpsw,5664
|
|
11
|
+
prettyopenapi/_ui/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2,sha256=Nlt6jq_wIrE-0FYf3jiQoEowUH13Ps1a2zrKjnZqKFw,4228
|
|
12
|
+
prettyopenapi/_ui/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2,sha256=3gJBU2mJjZqi2fMDebbCAfwcCnAXWJ2XN0fZk6aPcJs,4308
|
|
13
|
+
prettyopenapi/_ui/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff,sha256=XXjQ14WZdPQfxJscrkQuJVdQFmcMWUbC0TF2YcSnKK0,5700
|
|
14
|
+
prettyopenapi/_ui/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff,sha256=ZYue4HsCSc-RCo1vPYEtRsliuugdc3mgNVsds1xhWG8,27496
|
|
15
|
+
prettyopenapi/_ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2,sha256=FEJbqcaVdjwVR_SKIGt6pgNQozriPeCfBAeHfz_Nies,21168
|
|
16
|
+
prettyopenapi/_ui/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff,sha256=P0rQaHvLDtxZbHyFE4xRQLo6nFo84u6UTydgjA8Yurk,28180
|
|
17
|
+
prettyopenapi/_ui/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2,sha256=QAxr_aGNXRSsrRwV1ty5-OE8AV5yhjF-C5pIJTm-8Uc,21860
|
|
18
|
+
prettyopenapi/_ui/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2,sha256=UF37qOy-d-gnZfNtMX7X70rEJxncX0rmjRxIP9ItDRQ,7336
|
|
19
|
+
prettyopenapi/_ui/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff,sha256=5xMbv1keHtm3TkThYvajmv-gCsIWVMtoNYXQhXM_Y1U,10128
|
|
20
|
+
prettyopenapi/_ui/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2,sha256=kImarBwVVSwCj9IFN2u1N6KlIFFk_oYm76utd9cmDCA,7512
|
|
21
|
+
prettyopenapi/_ui/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff,sha256=f1-9fK9v76Zl5lAVIl_qdrWdQlp7xGRd_Xfm632zXqI,10316
|
|
22
|
+
prettyopenapi/_ui/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff,sha256=Hf4PdA-oZAkDQFjklHSwESaunqjB7NqQWRe5DVfwOwA,5372
|
|
23
|
+
prettyopenapi/_ui/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff,sha256=HjQh4PFxdDdOpLYQPS8BGM-RTDYATKEM1LCSuDkO5u0,5476
|
|
24
|
+
prettyopenapi/_ui/assets/manrope-cyrillic-wght-normal-Dvxsihut.woff2,sha256=wmi0Wakynln-zzmhdhjv1Exxc1UyBI1gsSqrdqjBSRQ,14500
|
|
25
|
+
prettyopenapi/_ui/assets/manrope-greek-wght-normal-DL7QRZyv.woff2,sha256=L7Loy_1SrkYXmotgJOsWLx-cbePSLW46MNjzld5yIL4,9444
|
|
26
|
+
prettyopenapi/_ui/assets/manrope-latin-ext-wght-normal-Ch3YOpNY.woff2,sha256=ORG2bZ8uAFpLmJIjQF0OUDJhnGaFl7pGfMdqI8j__Ps,15120
|
|
27
|
+
prettyopenapi/_ui/assets/manrope-latin-wght-normal-DHIcAJRg.woff2,sha256=ow3c00lwOv90ZMNL7z__3_QF7lDBE0QNfIaTwC0hCXI,24836
|
|
28
|
+
prettyopenapi/_ui/assets/manrope-vietnamese-wght-normal-usUDDRr7.woff2,sha256=a7sESrQg4H7bCjBC0usxS4XoOgGC6UWhWrO5CSZo39U,8520
|
|
29
|
+
prettyopenapi/_ui/assets/spec-Desh2iqS.js,sha256=Kd3gfbw3yS4LupVx-AuT5PlhBWCGpZTdKnJKhQFi_Zo,9564
|
|
30
|
+
prettyopenapi-0.1.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
31
|
+
prettyopenapi-0.1.0.dist-info/licenses/THIRD_PARTY_LICENSES.md,sha256=Nim39b7N4b0P9C04M5T7GpTwgE6VoTpP3hpU1g7-L8U,139342
|
|
32
|
+
prettyopenapi-0.1.0.dist-info/METADATA,sha256=MAwi0wJRZEJT4Bhwjpec3_XdcvrDZhyxwPgNPUGgF0I,4894
|
|
33
|
+
prettyopenapi-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
34
|
+
prettyopenapi-0.1.0.dist-info/top_level.txt,sha256=y6XpU4YPThVDhmYGqUAVGxVRUy20oX0F68PXI2CURcE,14
|
|
35
|
+
prettyopenapi-0.1.0.dist-info/RECORD,,
|