-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
57 lines (52 loc) · 1.22 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
openapi: 3.0.3
info:
title: "Captcha Service"
description: "Generates and validates captchas"
version: "1.0"
servers:
- url: http://localhost:3000/v1
- url: https://nb-captcha-api.herokuapp.com/v1
paths:
/captchas:
post:
summary: "Generates a new captcha"
responses:
'201':
description: "Captcha generated"
content:
application/json:
schema:
type: object
properties:
id:
$ref: '#/components/schemas/id'
jpegBase64:
type: string
format: base64
/captchas/{id}:
put:
summary: "Validates a captcha"
parameters:
- in: path
name: id
required: true
schema:
$ref: '#/components/schemas/id'
requestBody:
content:
application/json:
schema:
type: object
properties:
answer:
type: string
responses:
'200':
description: "Correct answer"
'401':
description: "Wrong answer"
components:
schemas:
id:
type: string
format: uuid