-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yml
124 lines (117 loc) · 2.9 KB
/
swagger.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
openapi: 3.0.0
info:
title: User Management API
contact: {
name: "Lambda Support",
email: "[email protected]"
}
version: 1.0.0
description: API for managing users, including authentication and creation.
servers:
- url: http://localhost:8000
paths:
/login:
post:
summary: Authenticate a user
description: Returns JWT signed cookie.
operationId: login
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LoginRequest'
responses:
'200':
description: Successful login
headers:
Set-Cookie:
schema:
type: string
example: authtoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImFkbWluQGVsYW4ub3JnLmluIiwiZXhwIjoxNzEwNjAxNzQ4fQ.mPTyj962wxIK-pVZVn7kKvjpvpn_D1J6KYnWIgiOJu8; Secure; HttpOnly
content:
application/json:
schema:
$ref: '#/components/schemas/LoginResponse'
'404':
description: User not found
headers:
err:
schema:
type: string
example: User not found
'400':
description: Bad request
headers:
err:
schema:
type: string
example: Method not allowed
/createuser:
post:
summary: Create a new user
description: Creates a new user based on name, email and password.
operationId: createNewUser
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateUserRequest'
responses:
'200':
description: User created successfully
'400':
description: Bad request
headers:
err:
schema:
type: string
example: Method not allowed
/:
get:
summary: Redirect to elan.org.in
responses:
'307':
description: Temporary redirect
headers:
Location:
schema:
type: string
example: https://elan.org.in?utm_source=elan_bug
components:
schemas:
LoginRequest:
type: object
properties:
email:
type: string
password:
type: string
required:
- email
- password
LoginResponse:
type: object
properties:
user_id:
type: integer
status:
type: string
name:
type: string
email:
type: string
CreateUserRequest:
type: object
properties:
name:
type: string
email:
type: string
password:
type: string
required:
- name
- email
- password