Update: api schema
This commit is contained in:
parent
433a783c3a
commit
100536a5a8
1 changed files with 193 additions and 52 deletions
245
schema.yml
245
schema.yml
|
@ -1,36 +1,9 @@
|
||||||
openapi: 3.0.3
|
openapi: 3.0.3
|
||||||
info:
|
info:
|
||||||
title: Gallery-Archivist API
|
title: Gallery-Archiver API
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
description: A tool for archiving online galleries
|
description: A tool for archiving online galleries
|
||||||
paths:
|
paths:
|
||||||
/api/auth/logout/:
|
|
||||||
post:
|
|
||||||
operationId: auth_logout_create
|
|
||||||
tags:
|
|
||||||
- auth
|
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Logout'
|
|
||||||
application/x-www-form-urlencoded:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Logout'
|
|
||||||
multipart/form-data:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Logout'
|
|
||||||
required: true
|
|
||||||
security:
|
|
||||||
- cookieAuth: []
|
|
||||||
- jwtAuth: []
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Logout'
|
|
||||||
description: ''
|
|
||||||
/api/auth/token/:
|
/api/auth/token/:
|
||||||
post:
|
post:
|
||||||
operationId: auth_token_create
|
operationId: auth_token_create
|
||||||
|
@ -58,6 +31,33 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/TokenObtainPair'
|
$ref: '#/components/schemas/TokenObtainPair'
|
||||||
description: ''
|
description: ''
|
||||||
|
/api/auth/token/blacklist/:
|
||||||
|
post:
|
||||||
|
operationId: auth_token_blacklist_create
|
||||||
|
description: |-
|
||||||
|
Takes a token and blacklists it. Must be used with the
|
||||||
|
`rest_framework_simplejwt.token_blacklist` app installed.
|
||||||
|
tags:
|
||||||
|
- auth
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/TokenBlacklist'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/TokenBlacklist'
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/TokenBlacklist'
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/TokenBlacklist'
|
||||||
|
description: ''
|
||||||
/api/auth/token/refresh/:
|
/api/auth/token/refresh/:
|
||||||
post:
|
post:
|
||||||
operationId: auth_token_refresh_create
|
operationId: auth_token_refresh_create
|
||||||
|
@ -123,6 +123,102 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/CreatorDetails'
|
$ref: '#/components/schemas/CreatorDetails'
|
||||||
description: ''
|
description: ''
|
||||||
|
/api/files/{file_hash}/:
|
||||||
|
get:
|
||||||
|
operationId: files_retrieve
|
||||||
|
description: Handle GET requests for file serving.
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: d
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: Download flag (0 = download, otherwise inline)
|
||||||
|
- in: path
|
||||||
|
name: file_hash
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
- in: query
|
||||||
|
name: t
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: Thumbnail size (sx, sm, md, lg, xl)
|
||||||
|
- in: query
|
||||||
|
name: token
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: JWT token for authentication (alternative to Authorization header)
|
||||||
|
tags:
|
||||||
|
- files
|
||||||
|
security:
|
||||||
|
- cookieAuth: []
|
||||||
|
- jwtAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: File returned successfully
|
||||||
|
'401':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: ''
|
||||||
|
'404':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: ''
|
||||||
|
'500':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: ''
|
||||||
|
/api/files/{file_hash}/info/:
|
||||||
|
get:
|
||||||
|
operationId: files_info_retrieve
|
||||||
|
description: Return file metadata.
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: file_hash
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
- in: query
|
||||||
|
name: token
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: JWT token for authentication (alternative to Authorization header)
|
||||||
|
tags:
|
||||||
|
- files
|
||||||
|
security:
|
||||||
|
- cookieAuth: []
|
||||||
|
- jwtAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PostFile'
|
||||||
|
description: ''
|
||||||
|
'401':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: ''
|
||||||
|
'404':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: ''
|
||||||
|
'500':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ErrorResponse'
|
||||||
|
description: ''
|
||||||
/api/posts/:
|
/api/posts/:
|
||||||
get:
|
get:
|
||||||
operationId: posts_list_all
|
operationId: posts_list_all
|
||||||
|
@ -151,27 +247,6 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/PaginatedPostPreviewList'
|
$ref: '#/components/schemas/PaginatedPostPreviewList'
|
||||||
description: ''
|
description: ''
|
||||||
/api/posts/{post_id}/:
|
|
||||||
get:
|
|
||||||
operationId: posts_retrieve_by_id
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: post_id
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
tags:
|
|
||||||
- posts
|
|
||||||
security:
|
|
||||||
- cookieAuth: []
|
|
||||||
- jwtAuth: []
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Post'
|
|
||||||
description: ''
|
|
||||||
/api/posts/{source_site}/:
|
/api/posts/{source_site}/:
|
||||||
get:
|
get:
|
||||||
operationId: posts_list_by_source
|
operationId: posts_list_by_source
|
||||||
|
@ -317,6 +392,32 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Post'
|
$ref: '#/components/schemas/Post'
|
||||||
description: ''
|
description: ''
|
||||||
|
/api/posts/{source_site}/{post_id}/:
|
||||||
|
get:
|
||||||
|
operationId: posts_retrieve_by_id
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: post_id
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
- in: path
|
||||||
|
name: source_site
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- posts
|
||||||
|
security:
|
||||||
|
- cookieAuth: []
|
||||||
|
- jwtAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Post'
|
||||||
|
description: ''
|
||||||
/api/user/profile/:
|
/api/user/profile/:
|
||||||
get:
|
get:
|
||||||
operationId: user_profile_retrieve
|
operationId: user_profile_retrieve
|
||||||
|
@ -481,13 +582,15 @@ components:
|
||||||
- name
|
- name
|
||||||
- slug
|
- slug
|
||||||
- source_site
|
- source_site
|
||||||
Logout:
|
ErrorResponse:
|
||||||
type: object
|
type: object
|
||||||
|
description: Serializer for error responses.
|
||||||
properties:
|
properties:
|
||||||
refresh:
|
error:
|
||||||
type: string
|
type: string
|
||||||
|
description: Error message
|
||||||
required:
|
required:
|
||||||
- refresh
|
- error
|
||||||
PaginatedPostPreviewList:
|
PaginatedPostPreviewList:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
|
@ -589,6 +692,36 @@ components:
|
||||||
- source_site
|
- source_site
|
||||||
- tags
|
- tags
|
||||||
- title
|
- title
|
||||||
|
PostFile:
|
||||||
|
type: object
|
||||||
|
description: Serializer for PostFileModel.
|
||||||
|
properties:
|
||||||
|
hash_blake3:
|
||||||
|
type: string
|
||||||
|
maxLength: 128
|
||||||
|
file_type:
|
||||||
|
type: string
|
||||||
|
maxLength: 16
|
||||||
|
file:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
thumbnail:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
filename:
|
||||||
|
type: string
|
||||||
|
readOnly: true
|
||||||
|
thumbnails:
|
||||||
|
type: string
|
||||||
|
readOnly: true
|
||||||
|
download_url:
|
||||||
|
type: string
|
||||||
|
readOnly: true
|
||||||
|
required:
|
||||||
|
- download_url
|
||||||
|
- filename
|
||||||
|
- hash_blake3
|
||||||
|
- thumbnails
|
||||||
PostPreview:
|
PostPreview:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
@ -654,6 +787,14 @@ components:
|
||||||
- source_site
|
- source_site
|
||||||
- tags
|
- tags
|
||||||
- title
|
- title
|
||||||
|
TokenBlacklist:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
refresh:
|
||||||
|
type: string
|
||||||
|
writeOnly: true
|
||||||
|
required:
|
||||||
|
- refresh
|
||||||
TokenObtainPair:
|
TokenObtainPair:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue