-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger-testing.yaml
90 lines (87 loc) · 2.21 KB
/
swagger-testing.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
swagger: "2.0"
info:
title: UserAPI
description: User API
version: 1.0.0
host: api.flozano.github.io
schemes:
- https
paths:
/users:
post:
operationId: PostTenant
description: |-
Create a tenant.
parameters:
- name: user-info
in: body
description: |
User data to register
required: true
schema:
$ref: '#/definitions/UserNew'
responses:
'201':
description: Successful response
definitions:
AlertMethod:
type: string
enum:
- email
- sms
- push
- NONE
UserPassword:
description: |
A type for password for users.
type: string
minLength: 6
maxLength: 50
Role:
type: string
enum:
- admin
- technician
- observer
AlertMethods:
description: |
List of prefered alert methods.
It can be combination of `"email"`, `"sms"`, and `"push"` value.
`"NONE"` is a special value that can't be combined with other values.
type: array
items: { $ref: '#/definitions/AlertMethod' }
maxItems: 3
uniqueItems: true
Metadata:
type: object
UserNew:
type: object
description: |
Object to create a new user.
alertMethod is deprecated. Please use alertMethods instead
of it. alertMethod and alertMethods are exclusive.
properties:
email:
description: Email address for new user.
type: string
minLength: 1
password: { $ref: '#/definitions/UserPassword' }
role:
allOf:
- description: if role is omitted, `"technician"` is used as default.
- $ref: '#/definitions/Role'
smsNumber:
description: unavailable `smsNumber` is forbidden if `alertMethod` is `"sms"` or `alertMethods` includes `"sms"`.
type: string
alertMethod:
allOf:
- description: |-
`alertMethod` is deprecated. Please use `alertMethods`
instead of it.
- $ref: '#/definitions/AlertMethod'
alertMethods: { $ref: '#/definitions/AlertMethods' }
metadata: { $ref: '#/definitions/Metadata' }
additionalProperties: false
required:
- email
- password