-
Notifications
You must be signed in to change notification settings - Fork 33
/
User.js
142 lines (139 loc) · 2.9 KB
/
User.js
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
/**
* User.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
/**
* @swagger
*
* /User:
* description: |
* You might write a short summary of how this **User** model works and what it represents here.
*
* tags:
* - User (ORM)
* - User (ORM duplicate)
*
* /allActions:
* externalDocs:
* url: https://somewhere.com/yep
* description: Refer to these docs for more info
*
* /find:
* description: >
* _Alternate description_: Find a list of **User** records that match the specified criteria.
*
* tags:
*
* - name: User (ORM)
* description: |
* A longer, multi-paragraph description
* explaining how this all works.
*
* It is linked to more information.
*
* externalDocs:
* url: https://somewhere.com/yep
* description: Refer to these docs
*
* components:
* examples:
* modelDummy:
* summary: A model example example
* value: dummy
*/
module.exports = {
attributes: {
id: {
type: "number",
autoIncrement: true,
},
names: {
type: "string",
required: true,
example: "First Middle Last",
},
email: {
type: "string",
isEmail: true,
description: "Just any old email",
},
sex: {
type: "string",
isIn: ["Male", "Female"],
},
ageLimit: {
type: "number",
min: 15,
max: 100,
},
advancedOptions: {
type: "json",
example: {
useDefaults: false,
customName: 'foobar',
},
},
advancedOptionsAny: {
type: "json",
example: {
useDefaults: false,
customName: 'foobar again',
},
meta: { swagger: { type: null } },
},
data: {
description: "Some custom JSON data",
type: "ref",
columnType: "MEDIUMBLOB",
example: {
lots: 'lot',
data: [3, 4, 5],
more: [3.3, 2.344],
andMore: ['mixed', 3, true],
}
},
pets: {
collection: "Pet",
via: "owner",
},
favouritePet: {
model: "Pet",
},
neighboursPets: {
collection: "Pet",
via: "caredForBy",
},
createdAt: {
type: "ref",
columnType: "DATETIME",
autoCreatedAt: true,
},
updatedAt: {
type: "ref",
columnType: "DATETIME",
autoUpdatedAt: true,
},
},
swagger: {
actions: {
findone: {
description:
"_Alternate description_: Look up the **User** record with the specified ID.",
},
},
tags: [
{
name: "User (ORM duplicate)",
externalDocs: {
url: "https://somewhere.com/alternate",
description: "Refer to these alternate docs",
},
},
],
components: {
parameters: [],
},
},
};