This repository was archived by the owner on Sep 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel-schema.json
More file actions
177 lines (177 loc) · 6.77 KB
/
model-schema.json
File metadata and controls
177 lines (177 loc) · 6.77 KB
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
{
"id": "https://themost.io/schemas/2015/1/model-schema.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"@id": {
"type": "string",
"description":"A string which represents a literal unique identifier for this model e.g. https://example.com/models/User"
},
"name": {
"type": "string",
"description":"A string which represents the name of this model e.g. Order, Customer, Person etc"
},
"id": {
"type": "number",
"description":"An optional numeric identifier for this model e.g. 9587891"
},
"title": {
"type": "string",
"description":"A string which represents the title of this e.g. Supplier Orders, Person Followers etc"
},
"inherits": {
"type": "string",
"description":"A string which represents the model which is inherited by this model e.g. User inherits Account, Person inherits Party etc"
},
"sealed": {
"default": false,
"type": "boolean",
"description": "A boolean which indicates whether this model is being upgraded automatically or not. The default value is false."
},
"abstract": {
"default": false,
"type": "boolean",
"description": "A boolean which indicates whether this model is an abstract model or not. The default value is false."
},
"source": {
"type": "string",
"description": "A string which holds the database object of this model. If this property is missing the database object's name is the concatenation of the model's name and the keyword 'Base' e.g. UserBase, PersonBase etc"
},
"view": {
"type": "string",
"description": "A string which holds the database object that is going to be used for fetching data. If this property is missing this database object's name is the concatenation of the model's name and the keyword 'Data' e.g. UserData, PersonData etc"
},
"version": {
"default":"1.0",
"type": "string",
"pattern":"^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
"description": "A string which represents the version of the model's schema. This version is going to be used in model upgrade operations e.g. 1.0, 0.1.2 etc"
},
"caching":{
"default": "none",
"type":"string",
"enum": ["none", "always", "conditional"],
"description":"A boolean which indicates whether model data will be cached or not. The default value is none -no caching-. A conditional caching allows developers to control caching mechanism while fetching data."
},
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@id": {
"type": "string",
"description":"A string which represents a literal unique identifier for this attribute e.g. https://example.com/models/attributes/name"
},
"name": {
"type": "string",
"description":"A string which represents the name of this attribute e.g. title, description, dateCreated etc"
},
"title": {
"type": "string",
"description":"A string which represents a short description for this attribute"
},
"type": {
"type": "string",
"description":"A string which represents the type of this attribute e.g. Counter, Integer, Number, Text etc"
},
"size": {
"type": "number",
"description":"A number which represents the maximum size for this attribute e.g. the size of a text field etc"
},
"nullable": {
"default":true,
"type": "boolean",
"description": "A boolean which indicates whether this attribute is nullable or not."
},
"primary": {
"type": "boolean",
"description": "A boolean which indicates whether this attribute is a key column or not."
},
"indexed": {
"default":false,
"type": "boolean",
"description": "A boolean which indicates whether this attribute is an indexed column or not."
},
"property": {
"type": "string",
"description":"A string which optionally represents the name of this attribute in object mapping. This name may defer from the name of the database field."
},
"many": {
"type": "boolean",
"description": "A boolean value which indicates whether this attribute represents an one-to-many or many-to-many association between two models."
},
"expandable": {
"default":false,
"type": "boolean",
"description": "A boolean value which indicates whether the associated object(s) will be automatically expanded or not."
},
"mapping": {
"type": "object",
"properties": {
"associationType": {
"type": "string",
"enum": ["association", "junction" ]
},
"associationAdapter": {
"type": "string"
},
"parentModel": {
"type": "string"
},
"parentField": {
"type": "string"
},
"childModel": {
"type": "string"
},
"childField": {
"type": "string"
},
"cascade": {
"type": "string",
"enum": ["delete", "none"]
}
}
}
},
"required": [
"name"
]
}
},
"privileges": {
"type": "array",
"items": {
"type": "object",
"properties": {
"mask": {
"default":15,
"type": "number",
"description":"A number which represents permission mask (1=Read,2=Create,4=Update,8=Delete,16=Execute)",
"enum":[1,2,4,8,15,16]
},
"type": {
"type": "string",
"enum":["self","global","parent","item"],
"description": "A string which represents the permission scope."
},
"account": {
"type": "string",
"description": "A string which represents the name of the security group where this privilege will be applied e.g. Administrators, Sales etc."
},
"filter": {
"type": "string",
"description": "A string which represents a filter expression for this privilege. This attribute is used for self privileges which are commonly derived from user's attributes e.g. 'owner eq me()' or 'orderStatus eq 1 and customer eq me()' etc."
}
},
"required": [
"mask",
"type"
]
}
}
},
"required": [
"name", "title", "version"
]
}