-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
129 lines (129 loc) · 3.17 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
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
125
126
127
128
129
swagger: '2.0'
info:
title: Easy Planner Service API
description: 'Simple Events Planning application - Easy Planner, helping users to create event and invite friends to join, built during the Cloud and Big Data course at Columbia University.'
version: 1.0.0
schemes:
- https
basePath: /v1
produces:
- application/json
paths:
/events/create:
post:
summary: The endpoint for Event Creation API.
description: |
This API takes in one or more events from the client and returns
OK or Error as a response. The API will try to store the events into
the backend database.
tags:
- Events
operationId: createEvent
produces:
- application/json
parameters:
- in: body
name: event
description: The event to create.
required: true
schema:
$ref: '#/definitions/Event'
responses:
'200':
description: OK
schema:
$ref: '#/definitions/Error'
'403':
description: Unauthorized
schema:
$ref: '#/definitions/Error'
'500':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/events/view:
get:
summary: The endpoint for Event Viewing API.
description: |
This API takes in a UserId from the client and returns one or more
events as a response. The API will try to retrieve the events whose
host is the same as the given UserId from the backend database.
tags:
- Events
operationId: viewEvent
produces:
- application/json
parameters:
- in: body
name: user
description: The UserId whose events to view.
required: true
schema:
type: string
responses:
'200':
description: OK
schema:
$ref: '#/definitions/EventViewResponse'
'403':
description: Unauthorized
schema:
$ref: '#/definitions/Error'
'500':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
Event:
type: object
required:
- host
- name
- destName
- destId
properties:
host:
description: 'Host user''s UserId'
type: string
id:
type: string
name:
type: string
destName:
type: string
destId:
type: string
start:
type: string
format: datetime
end:
type: string
format: datetime
participants:
description: 'Participants is a list of UserIds, should include the host him/herself'
type: array
items:
type: string
EventViewResponse:
type: object
properties:
events:
type: array
items:
$ref: '#/definitions/Event'
User:
type: object
properties:
host:
description: 'Host user''s UserId'
type: string
id:
type: string
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string