mobile-api-example/docs/swagger.json
2026-01-03 15:25:31 +03:00

170 lines
No EOL
5.1 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"swagger": "2.0",
"info": {
"title": "Mobile Example API",
"contact": {},
"version": "1.0.0"
},
"basePath": "/api",
"paths": {
"/auth/login": {
"post": {
"description": "Логин. Принимает пару юзернейм+пароль.",
"consumes": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Логин",
"parameters": [
{
"description": "логин",
"name": "login",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.loginDTO"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/auth/logout": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Логаут. Принимает токен авторизации в заголовке \"Authorization\"",
"tags": [
"Auth"
],
"summary": "Логаут",
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/auth/me": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Информация о пользователе. Выдается по токену сессии. Без поля пароль.",
"tags": [
"Auth"
],
"summary": "Информация о пользователе",
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
}
}
},
"/auth/register": {
"post": {
"description": "Регистрация",
"consumes": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Регистрация",
"parameters": [
{
"description": "Регистрация",
"name": "register",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/auth.user"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"500": {
"description": "Internal Server Error"
}
}
}
}
},
"definitions": {
"auth.loginDTO": {
"type": "object",
"properties": {
"login": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"auth.user": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"password": {
"type": "string"
},
"surname": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"description": "Введите \"token\" для аутентификации",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}