-
Notifications
You must be signed in to change notification settings - Fork 3
/
swagger.yaml
171 lines (171 loc) · 4.01 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
swagger: "2.0"
info:
description: 'This is a sample test application to demonstrate vREST NG and vREST Cloud.'
version: "1.0.0"
title: "vREST Contacts Application"
contact:
email: "[email protected]"
tags:
- name: "CRUD APIs"
description: "CRUD APIs"
paths:
/contacts:
post:
operationId: "addContact"
tags:
- "CRUD APIs"
summary: "Create a new contact"
description: ""
consumes:
- "application/x-www-form-urlencoded"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: true
schema:
$ref: "#/definitions/ContactWithoutId"
responses:
400:
description: "Invalid Input"
schema:
$ref: '#/definitions/Error'
200:
description: "Success Response"
schema:
$ref: "#/definitions/Contact"
/contacts/{contactId}:
get:
operationId: "findContactById"
tags:
- "CRUD APIs"
summary: "Find contact by id"
produces:
- "application/json"
parameters:
- name: "contactId"
in: "path"
description: "ID of contact to return"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Contact"
400:
description: "Invalid Input"
schema:
$ref: '#/definitions/Error'
put:
operationId: "updateContactById"
tags:
- "CRUD APIs"
summary: "Update contact by id"
consumes:
- "application/x-www-form-urlencoded"
produces:
- "application/json"
parameters:
- name: "contactId"
in: "path"
description: "ID of contact to update"
required: true
type: "string"
- in: "formData"
type: "string"
name: "name"
description: "Contact Name"
- in: "formData"
type: "string"
name: "email"
description: "Contact Email"
- in: "formData"
type: "string"
name: "designation"
description: "Contact Designation"
- in: "formData"
type: "string"
name: "organization"
description: "Organization Information"
- in: "formData"
type: "string"
name: "country"
description: "Country Information"
- in: "formData"
type: "string"
name: "aboutMe"
description: "AboutMe Information"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/Contact"
400:
description: "Invalid Input"
schema:
$ref: '#/definitions/Error'
delete:
operationId: "deleteContactById"
tags:
- "CRUD APIs"
summary: "Delete contact by id"
produces:
- "application/json"
parameters:
- name: "contactId"
in: "path"
description: "ID of contact to delete"
required: true
type: "string"
responses:
200:
description: "successful operation"
400:
description: "Invalid Input"
schema:
$ref: '#/definitions/Error'
definitions:
ContactWithoutId:
type: "object"
properties:
name:
type: string
email:
type: string
designation:
type: string
organization:
type: string
country:
type: string
aboutMe:
type: string
twitterId:
type: string
facebookId:
type: string
githubId:
type: string
Contact:
allOf:
- $ref: '#/definitions/ContactWithoutId'
- type: object
properties:
_id:
type: "string"
ContactList:
type: "array"
items:
$ref: "#/definitions/Contact"
Error:
type: object
properties:
errors:
type: object
GenericError:
type: object
properties:
error:
type: "string"