-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.yml
462 lines (453 loc) · 16.2 KB
/
common.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
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
openapi: 3.0.0
info:
version: 1.0.0
title: Common Object Definitions
description: Definitions of common objects used across the modules. These objects will/may be commonly used by all eGov API deicitions. There are no paths defined in this spec as these objects cannot be used solely on their own.
contact:
name: eGov
email: [email protected]
paths: {}
components:
schemas:
RequestInfo:
type: object
description: RequestInfo should be used to carry meta information about the requests to the server as described in the fields below. All eGov APIs will use requestinfo as a part of the request body to carry this meta information. Some of this information will be returned back from the server as part of the ResponseInfo in the response body to ensure correlation.
properties:
apiId:
type: string
description: unique API ID
maxLength: 128
ver:
type: string
description: API version - for HTTP based request this will be same as used in path
maxLength: 32
ts:
type: integer
format: int64
description: time in epoch
action:
type: string
description: API action to be performed like _create, _update, _search (denoting POST, PUT, GET) or _oauth etc
maxLength: 32
did:
type: string
description: Device ID from which the API is called
maxLength: 1024
key:
type: string
description: API key (API key provided to the caller in case of server to server communication)
maxLength: 256
msgId:
type: string
description: Unique request message id from the caller
maxLength: 256
requesterId:
type: string
description: UserId of the user calling
maxLength: 256
authToken:
type: string
description: //session/jwt/saml token/oauth token - the usual value that would go into HTTP bearer token
userInfo:
$ref: '#/components/schemas/User'
correlationId:
type: string
readOnly: true
required:
- apiId
- ver
- ts
- msgId
- action
User:
type: object
description: This is acting ID token of the authenticated user on the server. Any value provided by the clients will be ignored and actual user based on authtoken will be used on the server.
readOnly: true
properties:
tenantId:
type: string
description: Unique Identifier of the tenant to which user primarily belongs
id:
type: integer
format: int32
description: User id of the authenticated user. Will be deprecated in future
uuid:
type: string
description: UUID of the user
userName:
type: string
description: Unique user name of the authenticated user
mobileNumber:
type: string
description: mobile number of the autheticated user
emailId:
type: string
description: email address of the authenticated user
roles:
type: array
description: List of all the roles
items:
$ref: '#/components/schemas/Role'
required:
- tenantId
- userName
- roles
UserInfo:
type: object
description: This is acting ID token of the authenticated user on the server. Any value provided by the clients will be ignored and actual user based on authtoken will be used on the server.
readOnly: true
properties:
tenantId:
type: string
description: Unique Identifier of the tenant to which user primarily belongs
uuid:
type: string
description: System Generated User id of the authenticated user.
userName:
type: string
description: Unique user name of the authenticated user
password:
type: string
description: password of the user.
idToken:
type: string
description: This will be the OTP.
mobile:
type: string
description: mobile number of the autheticated user
email:
type: string
description: email address of the authenticated user
primaryrole:
type: array
description: List of all the roles for the primary tenant
items:
$ref: '#/components/schemas/Role'
additionalroles:
type: array
description: array of additional tenantids authorized for the authenticated user
items:
$ref: '#/components/schemas/TenantRole'
required:
- tenantId
- userName
- primaryrole
Role:
type: object
description: |
minimal representation of the Roles in the system to be carried along in UserInfo with RequestInfo meta data. Actual authorization service to extend this to have more role related attributes
properties:
tenantId:
type: string
description: TenantId for which the role is given
id:
type: string
format: int32
description: id of the role
name:
type: string
description: Unique name of the role
maxLength: 64
description:
type: string
description: brief description of the role
required:
- code
- tenantId
TenantRole:
type: object
description: User role carries the tenant related role information for the user. A user can have multiple roles per tenant based on the need of the tenant. A user may also have multiple roles for multiple tenants.
properties:
tenantId:
type: string
description: tenantid for the tenant
roles:
type: array
description: Roles assigned for a particular tenant - array of role codes/names
items:
$ref: "#/components/schemas/Role"
required:
- tenantId
- roles
ResponseInfo:
type: object
readOnly: true
description: ResponseInfo should be used to carry metadata information about the response from the server. apiId, ver and msgId in ResponseInfo should always correspond to the same values in respective request's RequestInfo.
properties:
apiId:
type: string
description: unique API ID
maxLength: 128
ver:
type: string
description: API version
maxLength: 32
ts:
type: integer
format: int64
description: response time in epoch
resMsgId:
type: string
description: unique response message id (UUID) - will usually be the correlation id from the server
maxLength: 256
msgId:
type: string
description: message id of the request
maxLength: 256
status:
type: string
description: status of request processing - to be enhanced in futuer to include INPROGRESS
enum:
- SUCCESSFUL
- FAILED
required:
- apiId
- ver
- ts
- status
Error:
type: object
description: Error object will be returned as a part of reponse body in conjunction with ResponseInfo as part of ErrorResponse whenever the request processing status in the ResponseInfo is FAILED. HTTP return in this scenario will usually be HTTP 400.
properties:
code:
type: string
description: Error Code will be module specific error label/code to identiffy the error. All modules should also publish the Error codes with their specific localized values in localization service to ensure clients can print locale specific error messages. Example for error code would be User.NotFound to indicate User Not Found by User/Authentication service. All services must declare their possible Error Codes with brief description in the error response section of their API path.
message:
type: string
description: English locale message of the error code. Clients should make a separate call to get the other locale description if configured with the service. Clients may choose to cache these locale specific messages to enhance performance with a reasonable TTL (May be defined by the localization service based on tenant + module combination).
description:
type: string
description: Optional long description of the error to help clients take remedial action. This will not be available as part of localization service.
params:
type: array
description: Some error messages may carry replaceable fields (say $1, $2) to provide more context to the message. E.g. Format related errors may want to indicate the actual field for which the format is invalid. Client's should use the values in the param array to replace those fields.
items:
type: string
required:
- code
- message
ErrorRes:
type: object
description: All APIs will return ErrorRes in case of failure which will carry ResponseInfo as metadata and Error object as actual representation of error. In case of bulk apis, some apis may chose to return the array of Error objects to indicate individual failure.
properties:
ResponseInfo:
$ref: '#/components/schemas/ResponseInfo'
Errors:
description: Error response array corresponding to Request Object array. In case of single object submission or _search related paths this may be an array of one error element
type: array
minLength: 1
items:
$ref: '#/components/schemas/Error'
required:
- ResponseInfo
Address:
type: object
description: |
Representation of a address. Indiavidual APIs may choose to extend from this using allOf if more details needed to be added in their case.
properties:
tenantId:
type: string
description: Unique Identifier of the tenant to which user primarily belongs
doorNo:
type: string
description: House number or door number.
latitude:
type: number
format: double
description: latitude of the address
longitude:
type: number
format: double
description: longitude of the address
addressId:
type: string
description: System generated id for the address
readOnly: true
addressNumber:
description: House, Door, Building number in the address
type: string
type:
type: string
description: Blood group of the user.
items:
type: string
enum:
- PERMANENT
- CORRESPONDENCE
addressLine1:
description: Apartment, Block, Street of the address
type: string
addressLine2:
description: Locality, Area, Zone, Ward of the address
type: string
landmark:
description: additional landmark to help locate the address
type: string
city:
description: City of the address. Can be represented by the tenantid itself
type: string
pincode:
type: string
description: PIN code of the address. Indian pincodes will usually be all numbers.
detail:
type: string
description: more address detail as may be needed
buildingName:
type: string
description: Name of the building
maxLength: 64
minLength: 2
street:
type: string
description: Street Name
maxLength: 64
minLength: 2
boundary:
$ref: '#/components/schemas/Boundary'
boundaryType:
type: string
description: Locality or Ward or Circle or District code from MDMS
AuditDetails:
type: object
description: Collection of audit related fields used by most models
readOnly: true
properties:
createdBy:
type: string
description: username (preferred) or userid of the user that created the object
lastModifiedBy:
type: string
description: username (preferred) or userid of the user that last modified the object
createdTime:
type: integer
format: int64
description: epoch of the time object is created
lastModifiedTime:
type: integer
format: int64
description: epoch of the time object is last modified
Document:
description: >-
This object holds list of documents attached during the transaciton for
a property
type: object
properties:
id:
description: system id of the Document.
type: string
maxLength: 64
documentType:
description: >-
unique document type code, should be validated with document type
master
type: string
fileStore:
description: File store reference key.
type: string
documentUid:
description: The unique id(Pancard Number,Adhar etc.) of the given Document.
type: string
maxLength: 64
additionalDetails:
description: >-
Json object to capture any extra information which is not
accommodated by model
type: object
GeoLocation:
type: object
properties:
latitude:
description: latitude of the address
type: number
format: double
longitude:
description: longitude of the address
type: number
format: double
additionalDetails:
description: >-
Json object to capture any extra information which is not
accommodated by model
type: object
Pagination:
description: Pagination details
type: object
properties:
limit:
description: >-
Limit for total no of records in single search max limit should be
defined as envirnment variable
type: number
default: 10
maximum: 100
format: double
offSet:
description: offset or page no
type: number
default: 0
format: double
totalCount:
description: Total count for a perticular criteria
readOnly: true
type: number
format: double
sortBy:
description: result sorting order
type: string
order:
type: object
allOf:
- $ref: '#/components/schemas/Order'
- description: Sorting order
Workflow:
type: object
properties:
action:
description: Action of the workflow to be performned on the request
type: string
comment:
description: comment for the workflow action to be performed
type: string
assignees:
type: array
items:
type: string
required:
- action
Order:
description: Sorting order
type: string
enum:
- asc
- desc
Boundary:
type: object
properties:
code:
description: code of the boundary.
type: string
name:
description: name of the boundary.
type: string
label:
description: localized label for the boundry.
type: string
latitude:
description: latitude of the boundary.
type: string
longitude:
description: longitude of the boundary.
type: string
children:
type: array
items:
$ref: '#/components/schemas/Boundary'
materializedPath:
description: >-
materialized path of the boundary - this would be of the format
tenantid.[code] from parent till the current boundary
readOnly: true
type: string
required:
- code
- name