mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-03 04:19:06 +08:00
258fd433b5
part of #2605
392 lines
8.3 KiB
JSON
392 lines
8.3 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"version": "1.0.0",
|
|
"title": "Monkeytype",
|
|
"termsOfService": "http://monkeytype.com/terms-of-service",
|
|
"contact": {
|
|
"name": "Developer",
|
|
"email": "jack@monkeytype.com"
|
|
}
|
|
},
|
|
"host": "api.monkeytype.com",
|
|
"basePath": "/",
|
|
"schemes": ["https"],
|
|
"consumes": ["application/json"],
|
|
"produces": ["application/json"],
|
|
"tags": [
|
|
{
|
|
"name": "users",
|
|
"description": ""
|
|
},
|
|
{
|
|
"name": "tags",
|
|
"description": ""
|
|
}
|
|
],
|
|
"paths": {
|
|
"/users": {
|
|
"get": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/name": {
|
|
"patch": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/signup": {
|
|
"post": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"uid": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/checkName/{name}": {
|
|
"get": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "path",
|
|
"description": "",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/leaderboardMemory": {
|
|
"patch": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"mode": {
|
|
"type": "string"
|
|
},
|
|
"mode2": {
|
|
"type": "string"
|
|
},
|
|
"language": {
|
|
"type": "string"
|
|
},
|
|
"rank": {
|
|
"type": "number"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/discord/link": {
|
|
"post": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tokenType": {
|
|
"type": "string"
|
|
},
|
|
"accessToken": {
|
|
"type": "string"
|
|
},
|
|
"uid": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/discord/unlink": {
|
|
"post": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/email": {
|
|
"patch": {
|
|
"tags": ["users"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"newEmail": {
|
|
"type": "string"
|
|
},
|
|
"previousEmail": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/personalBests": {
|
|
"delete": {
|
|
"tags": ["users"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/tags": {
|
|
"get": {
|
|
"tags": ["tags"],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": ["tags"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tagName": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": ["tags"],
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tagId": {
|
|
"type": "string"
|
|
},
|
|
"newName": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/tags/{tagId}": {
|
|
"delete": {
|
|
"tags": ["tags"],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "tagId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/tags/{tagId}/personalBest": {
|
|
"delete": {
|
|
"tags": ["tags"],
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "tagId",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/Response"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"Response": {
|
|
"type": "object",
|
|
"required": ["error", "message"],
|
|
"properties": {
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"data": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|