|
interface SwaggerSchema { |
|
"openapi": "3.0.3", |
|
"paths": { |
|
"/__docs__/": { |
|
"get": { |
|
"operationId": "__docs___retrieve", |
|
"description": "OpenApi3 schema for this API. Format can be selected via content negotiation.\n\n- YAML: application/vnd.oai.openapi\n- JSON: application/vnd.oai.openapi+json", |
|
"parameters": [ |
|
{ |
|
"in": "query", |
|
"name": "format", |
|
"schema": { |
|
"type": "string", |
|
"enum": [ |
|
"json", |
|
"yaml" |
|
] |
|
} |
|
}, |
|
{ |
|
"in": "query", |
|
"name": "lang", |
|
"schema": { |
|
"type": "string", |
|
"enum": [ |
|
"de", |
|
"en", |
|
"ru" |
|
] |
|
} |
|
} |
|
], |
|
"tags": [ |
|
"__docs__" |
|
], |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
}, |
|
{} |
|
], |
|
"responses": { |
|
"200": { |
|
"content": { |
|
"application/vnd.oai.openapi": { |
|
"schema": { |
|
"type": "object", |
|
"additionalProperties": {} |
|
} |
|
}, |
|
"application/yaml": { |
|
"schema": { |
|
"type": "object", |
|
"additionalProperties": {} |
|
} |
|
}, |
|
"application/vnd.oai.openapi+json": { |
|
"schema": { |
|
"type": "object", |
|
"additionalProperties": {} |
|
} |
|
}, |
|
"application/json": { |
|
"schema": { |
|
"type": "object", |
|
"additionalProperties": {} |
|
} |
|
} |
|
}, |
|
"description": "" |
|
} |
|
} |
|
} |
|
}, |
|
"/account/me/": { |
|
"get": { |
|
"operationId": "account_me_retrieve", |
|
"tags": [ |
|
"account" |
|
], |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsMe" |
|
} |
|
} |
|
}, |
|
"description": "" |
|
}, |
|
"401": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AuthenticateInvalidToken" |
|
} |
|
} |
|
}, |
|
"description": "\tНеверный токен" |
|
} |
|
} |
|
}, |
|
"patch": { |
|
"operationId": "account_me_partial_update", |
|
"tags": [ |
|
"account" |
|
], |
|
"requestBody": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/PatchedAccountsMe" |
|
} |
|
}, |
|
"application/x-www-form-urlencoded": { |
|
"schema": { |
|
"$ref": "#/components/schemas/PatchedAccountsMe" |
|
} |
|
}, |
|
"multipart/form-data": { |
|
"schema": { |
|
"$ref": "#/components/schemas/PatchedAccountsMe" |
|
} |
|
} |
|
} |
|
}, |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsMe" |
|
} |
|
} |
|
}, |
|
"description": "" |
|
}, |
|
"401": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AuthenticateInvalidToken" |
|
} |
|
} |
|
}, |
|
"description": "\tНеверный токен" |
|
} |
|
} |
|
} |
|
}, |
|
"/account/me/password/": { |
|
"put": { |
|
"operationId": "account_me_password_update", |
|
"tags": [ |
|
"account" |
|
], |
|
"requestBody": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsMePassword" |
|
} |
|
}, |
|
"application/x-www-form-urlencoded": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsMePassword" |
|
} |
|
}, |
|
"multipart/form-data": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsMePassword" |
|
} |
|
} |
|
}, |
|
"required": true |
|
}, |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
} |
|
], |
|
"responses": { |
|
"204": { |
|
"description": "No response body" |
|
}, |
|
"401": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AuthenticateInvalidToken" |
|
} |
|
} |
|
}, |
|
"description": "\tНеверный токен" |
|
}, |
|
"200": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsMePassword" |
|
} |
|
} |
|
}, |
|
"description": null |
|
}, |
|
"403": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/MePasswordInvalidOldPassword" |
|
} |
|
} |
|
}, |
|
"description": "\tНеверный старый пароль" |
|
} |
|
} |
|
} |
|
}, |
|
"/account/me/supports/": { |
|
"post": { |
|
"operationId": "account_me_supports_create", |
|
"tags": [ |
|
"account" |
|
], |
|
"requestBody": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsSupports" |
|
} |
|
}, |
|
"application/x-www-form-urlencoded": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsSupports" |
|
} |
|
}, |
|
"multipart/form-data": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsSupports" |
|
} |
|
} |
|
}, |
|
"required": true |
|
}, |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
} |
|
], |
|
"responses": { |
|
"201": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsSupports" |
|
} |
|
} |
|
}, |
|
"description": "" |
|
}, |
|
"401": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AuthenticateInvalidToken" |
|
} |
|
} |
|
}, |
|
"description": "\tНеверный токен" |
|
} |
|
} |
|
} |
|
}, |
|
"/account/password/": { |
|
"get": { |
|
"operationId": "account_password_retrieve", |
|
"tags": [ |
|
"account" |
|
], |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
}, |
|
{} |
|
], |
|
"responses": { |
|
"302": { |
|
"description": "redirect:\n\n что-то пошло не так: https://merlines-frontend.vercel.app/\n\n всё нормально: https://merlines-frontend.vercel.app/#!/?password_session=\\<session_id\\>" |
|
} |
|
} |
|
}, |
|
"post": { |
|
"operationId": "account_password_create", |
|
"tags": [ |
|
"account" |
|
], |
|
"requestBody": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsPassword" |
|
} |
|
}, |
|
"application/x-www-form-urlencoded": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsPassword" |
|
} |
|
}, |
|
"multipart/form-data": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsPassword" |
|
} |
|
} |
|
}, |
|
"required": true |
|
}, |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
}, |
|
{} |
|
], |
|
"responses": { |
|
"204": { |
|
"description": "No response body" |
|
} |
|
} |
|
}, |
|
"put": { |
|
"operationId": "account_password_update", |
|
"tags": [ |
|
"account" |
|
], |
|
"requestBody": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsPasswordUpdate" |
|
} |
|
}, |
|
"application/x-www-form-urlencoded": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsPasswordUpdate" |
|
} |
|
}, |
|
"multipart/form-data": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsPasswordUpdate" |
|
} |
|
} |
|
}, |
|
"required": true |
|
}, |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
}, |
|
{} |
|
], |
|
"responses": { |
|
"200": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsPasswordUpdate" |
|
} |
|
} |
|
}, |
|
"description": null |
|
}, |
|
"408": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/PasswordSessionCodeTimeOut" |
|
} |
|
} |
|
}, |
|
"description": "\tКод просрочен" |
|
} |
|
} |
|
} |
|
}, |
|
"/account/register/": { |
|
"get": { |
|
"operationId": "account_register_retrieve", |
|
"tags": [ |
|
"account" |
|
], |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
}, |
|
{} |
|
], |
|
"responses": { |
|
"302": { |
|
"description": "redirect:\n\n что-то пошло не так: https://merlines-frontend.vercel.app/\n\n всё нормально: https://merlines-frontend.vercel.app/#!/?token=<token>" |
|
} |
|
} |
|
}, |
|
"post": { |
|
"operationId": "account_register_create", |
|
"tags": [ |
|
"account" |
|
], |
|
"requestBody": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsRegister" |
|
} |
|
}, |
|
"application/x-www-form-urlencoded": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsRegister" |
|
} |
|
}, |
|
"multipart/form-data": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsRegister" |
|
} |
|
} |
|
}, |
|
"required": true |
|
}, |
|
"security": [ |
|
{ |
|
"Token": [] |
|
}, |
|
{ |
|
"Cookie": [] |
|
}, |
|
{} |
|
], |
|
"responses": { |
|
"201": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/AccountsRegister" |
|
} |
|
} |
|
}, |
|
"description": null |
|
}, |
|
"409": { |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/RegisterEmailUnique" |
|
} |
|
} |
|
}, |
|
"description": "\tuser с таким email уже существует" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"components": { |
|
"schemas": { |
|
"AccountsMe": { |
|
"type": "object", |
|
"properties": { |
|
"first_name": { |
|
"type": "string" |
|
}, |
|
"last_name": { |
|
"type": "string", |
|
"nullable": true |
|
}, |
|
"email": { |
|
"type": "string", |
|
"format": "email", |
|
"readOnly": true |
|
}, |
|
"type": { |
|
"allOf": [ |
|
{ |
|
"$ref": "#/components/schemas/TypeEnum" |
|
}, |
|
{ |
|
"$ref": "#/components/schemas/FoodEnum" |
|
} |
|
], |
|
"readOnly": true, |
|
"description": "1 — BANNED (Banned)\n\n2 — DEFAULT (Default)\n\n3 — EDITOR (Editor)\n\n4 — ADMIN (Admin)\n\n5 — SUPER (Super)" |
|
}, |
|
"avatar": { |
|
"type": "string", |
|
"format": "uri", |
|
"nullable": true |
|
} |
|
}, |
|
"required": [ |
|
"email", |
|
"first_name", |
|
"type" |
|
] |
|
}, |
|
"AccountsMePassword": { |
|
"type": "object", |
|
"properties": { |
|
"old_password": { |
|
"type": "string", |
|
"writeOnly": true, |
|
"maxLength": 128 |
|
}, |
|
"new_password": { |
|
"type": "string", |
|
"writeOnly": true, |
|
"maxLength": 128 |
|
} |
|
}, |
|
"required": [ |
|
"new_password", |
|
"old_password" |
|
] |
|
}, |
|
"AccountsPassword": { |
|
"type": "object", |
|
"properties": { |
|
"email": { |
|
"type": "string", |
|
"format": "email", |
|
"writeOnly": true, |
|
"maxLength": 254 |
|
} |
|
}, |
|
"required": [ |
|
"email" |
|
] |
|
}, |
|
"AccountsPasswordUpdate": { |
|
"type": "object", |
|
"properties": { |
|
"password": { |
|
"type": "string", |
|
"writeOnly": true, |
|
"maxLength": 128 |
|
}, |
|
"session": { |
|
"type": "string", |
|
"writeOnly": true |
|
}, |
|
"token": { |
|
"type": "string", |
|
"readOnly": true |
|
} |
|
}, |
|
"required": [ |
|
"password", |
|
"session", |
|
"token" |
|
] |
|
}, |
|
"AccountsRegister": { |
|
"type": "object", |
|
"properties": { |
|
"email": { |
|
"type": "string", |
|
"format": "email", |
|
"writeOnly": true, |
|
"maxLength": 254 |
|
}, |
|
"password": { |
|
"type": "string", |
|
"writeOnly": true, |
|
"maxLength": 128 |
|
}, |
|
"first_name": { |
|
"type": "string", |
|
"writeOnly": true |
|
}, |
|
"last_name": { |
|
"type": "string", |
|
"writeOnly": true |
|
}, |
|
"id": { |
|
"type": "integer", |
|
"readOnly": true |
|
} |
|
}, |
|
"required": [ |
|
"email", |
|
"first_name", |
|
"id", |
|
"password" |
|
] |
|
}, |
|
"AccountsSupports": { |
|
"type": "object", |
|
"properties": { |
|
"text": { |
|
"type": "string", |
|
"writeOnly": true |
|
} |
|
}, |
|
"required": [ |
|
"text" |
|
] |
|
}, |
|
"AuthenticateInvalidToken": { |
|
"type": "object", |
|
"properties": { |
|
"error": { |
|
"type": "object", |
|
"additionalProperties": {}, |
|
"readOnly": true, |
|
"default": { |
|
"type": "warning", |
|
"code": "authenticate_invalid_token" |
|
} |
|
} |
|
}, |
|
"required": [ |
|
"error" |
|
] |
|
}, |
|
"FoodEnum": { |
|
"enum": [ |
|
0, |
|
1, |
|
2 |
|
], |
|
"type": "integer" |
|
}, |
|
"TypeEnum": { |
|
"enum": [ |
|
1, |
|
2, |
|
3, |
|
4, |
|
5 |
|
], |
|
"type": "integer" |
|
}, |
|
}, |
|
"securitySchemes": { |
|
"Cookie": { |
|
"type": "apiKey", |
|
"in": "cookie", |
|
"name": "sessionid" |
|
}, |
|
"Token": { |
|
"type": "apiKey", |
|
"in": "header", |
|
"name": "Authorization", |
|
"description": "Token-based authentication" |
|
} |
|
} |
|
} |
|
} |
|
|
|
export default SwaggerSchema |