mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2024-11-27 03:48:52 +03:00
OAS: example payload
This commit is contained in:
parent
8aeab69303
commit
55dd3fffe5
4 changed files with 20 additions and 6 deletions
File diff suppressed because one or more lines are too long
21
openapi.yaml
21
openapi.yaml
|
@ -17,6 +17,10 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/RegisterUser'
|
||||
example:
|
||||
username: "testuser"
|
||||
password: "mysuperlongandsecurepassword"
|
||||
email: "testuser@example.com"
|
||||
responses:
|
||||
'200':
|
||||
description: Successful registration
|
||||
|
@ -48,6 +52,9 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/LoginUser'
|
||||
example:
|
||||
username: "testuser"
|
||||
password: "mysuperlongandsecurepassword"
|
||||
responses:
|
||||
'200':
|
||||
description: Successful authentication
|
||||
|
@ -95,6 +102,8 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/DeleteUser'
|
||||
example:
|
||||
password: "mysuperlongandsecurepassword"
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
|
@ -128,6 +137,8 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserDetailCheck'
|
||||
example:
|
||||
val: "testuser"
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
|
@ -153,6 +164,8 @@ paths:
|
|||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/UserDetailCheck'
|
||||
example:
|
||||
val: "testuser@example.com"
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
|
@ -208,7 +221,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/addDomain'
|
||||
$ref: '#/components/schemas/AddDomain'
|
||||
|
||||
responses:
|
||||
'200':
|
||||
|
@ -246,7 +259,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/addDomain'
|
||||
$ref: '#/components/schemas/AddDomain'
|
||||
|
||||
responses:
|
||||
'200':
|
||||
|
@ -288,7 +301,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/addDomain'
|
||||
$ref: '#/components/schemas/AddDomain'
|
||||
|
||||
responses:
|
||||
'200':
|
||||
|
@ -332,7 +345,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/addDomain'
|
||||
$ref: '#/components/schemas/AddDomain'
|
||||
|
||||
responses:
|
||||
'200':
|
||||
|
|
|
@ -31,6 +31,8 @@ pub struct AddLevels {
|
|||
pub name: String,
|
||||
}
|
||||
|
||||
// TODO try for non-existent token names
|
||||
|
||||
#[post("/api/v1/mcaptcha/domain/token/levels/add")]
|
||||
pub async fn add_levels(
|
||||
payload: web::Json<AddLevels>,
|
||||
|
|
|
@ -138,7 +138,6 @@ impl ResponseError for ServiceError {
|
|||
ServiceError::ChallengeVerificationFailure => StatusCode::UNAUTHORIZED,
|
||||
ServiceError::CaptchaError(e) => match e {
|
||||
CaptchaError::MailboxError => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
|
||||
_ => StatusCode::BAD_REQUEST,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue