-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
86 lines (85 loc) · 2.06 KB
/
swagger.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
openapi: 3.0.3
info:
version: "1"
title: "OTP"
servers:
- url: "localhost:3000"
paths:
/otp/mobile/{mobileNumber}:
post:
summary: "Request an OTP SMS to be sent to the mobile number"
operationId: postMobileOtp
tags:
- OTP - Mobile
parameters:
- in: path
name: mobileNumber
required: true
description: Mobile number which requests the OTP
responses:
"200":
description: "Found at least one entity matched the query params"
content:
application/json:
schema:
$ref: "#/components/schemas/MobileOtpRequest"
"400":
description: "Invalid mobile number"
"503":
description: "Service unavailable"
/otp/mobile/ref/{referenceCode}/validations:
post:
summary: "Validate the OTP"
operationId: validateMobileOtp
tags:
- OTP - Mobile
parameters:
- in: path
name: referenceCode
required: true
description: OTP reference code
schema:
type: string
- in: body
name: otp
required: true
description: OTP
schema:
$ref: "#/components/schemas/OtpValidationRequest"
responses:
"200":
description: "The OTP is valid"
content:
application/json:
schema:
$ref: "#/components/schemas/AuthenticationToken"
"400":
description: "The OTP is invalid"
components:
schemas:
MobileOtpRequest:
type: object
properties:
referenceCode:
type: string
required:
- referenceCode
OtpValidationRequest:
type: object
properties:
otp:
type: string
required:
- otp
AuthenticationToken:
type: object
properties:
authenticationToken:
type: string
required:
- authenticationToken
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: sessionId