Leonid Nikitin
d72d6ff614
The "servers" section was deleted and the "/api/v1" part was added to "paths" values for a more refined URL structure. This change makes it more clear that the API version is part of the API route.
222 lines
7.4 KiB
JSON
222 lines
7.4 KiB
JSON
{
|
|
"openapi": "3.0.3",
|
|
"info": {
|
|
"title": "Captcha service - API",
|
|
"description": "API Documentation.",
|
|
"version": "1.0.0"
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "captcha",
|
|
"description": "Operations about captcha"
|
|
}
|
|
],
|
|
"paths": {
|
|
"/api/v1/captcha": {
|
|
"get": {
|
|
"tags": [
|
|
"captcha"
|
|
],
|
|
"summary": "Captcha generation",
|
|
"description": "",
|
|
"operationId": "captchaGeneration",
|
|
"parameters": [
|
|
{
|
|
"name": "public_token",
|
|
"in": "header",
|
|
"description": "Public token for captcha generation",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Captcha"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Invalid public token value"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"captcha"
|
|
],
|
|
"summary": "Checking captcha",
|
|
"description": "",
|
|
"operationId": "captchaChecking",
|
|
"parameters": [
|
|
{
|
|
"name": "public_token",
|
|
"in": "header",
|
|
"description": "Public token for captcha generation",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CaptchaChecking"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CaptchaVerification"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Invalid public token value"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/captcha/{captcha_key}": {
|
|
"get": {
|
|
"tags": [
|
|
"captcha"
|
|
],
|
|
"summary": "Verification Information",
|
|
"description": "",
|
|
"operationId": "CaptchaKeyInfo",
|
|
"parameters": [
|
|
{
|
|
"name": "private_token",
|
|
"in": "header",
|
|
"description": "Private token for captcha verification",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "captcha_key",
|
|
"in": "path",
|
|
"description": "The key that we received when generating the captcha",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful operation",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CaptchaKeyInfo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Invalid private token value"
|
|
},
|
|
"404": {
|
|
"description": "Captcha key not found"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"schemas": {
|
|
"Captcha": {
|
|
"type": "object",
|
|
"properties": {
|
|
"image_base64": {
|
|
"type": "string",
|
|
"format": "byte"
|
|
},
|
|
"image_text_base64": {
|
|
"type": "string",
|
|
"format": "byte"
|
|
},
|
|
"captcha_key": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"image_base64", "image_text_base64", "captcha_key"
|
|
]
|
|
},
|
|
"CaptchaVerification": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "boolean"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"status", "message"
|
|
]
|
|
},
|
|
"CaptchaChecking": {
|
|
"type": "object",
|
|
"properties": {
|
|
"captcha_key": {
|
|
"type": "string"
|
|
},
|
|
"verification": {
|
|
"type": "array",
|
|
"example": [{"x": 10, "y": 20}, {"x": 30, "y": 30}, {"x": 60, "y": 50}]
|
|
}
|
|
},
|
|
"required": [
|
|
"captcha_key", "verification"
|
|
]
|
|
},
|
|
"CaptchaKeyInfo": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"type": "boolean"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"status", "message"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|