@@ -69,8 +69,7 @@ UserModel:
69
69
path: webservice/user
70
70
equals_and_hash_code: false
71
71
properties:
72
- id:
73
- type: int
72
+ id: int
74
73
` ` `
75
74
76
75
# ## Ignored fields
@@ -87,8 +86,7 @@ UserModel:
87
86
id:
88
87
type: int
89
88
ignore_equality: true
90
- include:
91
- type: String
89
+ include: String
92
90
` ` `
93
91
94
92
# # explicit_to_json
@@ -108,8 +106,7 @@ UserModel:
108
106
path: webservice/user
109
107
explicit_to_json: false
110
108
properties:
111
- id:
112
- type: int
109
+ id: int
113
110
` ` `
114
111
115
112
# # toString
@@ -129,8 +126,7 @@ UserModel:
129
126
path: webservice/user
130
127
to_string: false
131
128
properties:
132
- id:
133
- type: int
129
+ id: int
134
130
` ` `
135
131
136
132
# # Extra imports and annotations
@@ -154,8 +150,7 @@ UserModel:
154
150
extra_annotations:
155
151
- '@someAnnotation'
156
152
properties:
157
- id:
158
- type: int
153
+ id: int
159
154
` ` `
160
155
161
156
# # Default values
@@ -178,7 +173,6 @@ UserModel:
178
173
default_value: 1
179
174
name:
180
175
type: String
181
- required: true
182
176
default_value: "'an example quoted string'"
183
177
` ` `
184
178
@@ -208,7 +202,6 @@ UserModel:
208
202
default_value: 1
209
203
name:
210
204
type: String
211
- required: true
212
205
default_value: "'an example quoted string'"
213
206
` ` `
214
207
@@ -223,7 +216,6 @@ UserModel:
223
216
default_value: 1
224
217
name:
225
218
type: String
226
- required: true
227
219
default_value: "'an example quoted string'"
228
220
disallow_null: true
229
221
` ` `
@@ -246,8 +238,7 @@ UserModel:
246
238
converters:
247
239
- DateTimeConverter
248
240
properties:
249
- id:
250
- type: int
241
+ id: int
251
242
` ` `
252
243
253
244
# # Extends
@@ -261,8 +252,7 @@ UserDetails:
261
252
path: webservice/user
262
253
extends: UserModel
263
254
properties:
264
- name:
265
- type: String
255
+ name: String
266
256
` ` `
267
257
268
258
# # Builtin types
@@ -288,37 +278,21 @@ UserModel:
288
278
converters:
289
279
- DateTimeConverter
290
280
properties:
291
- id:
292
- type: int
293
- name:
294
- type: String
295
- salary:
296
- type: double
297
- something:
298
- type: dynamic
281
+ id: int
282
+ name: String
283
+ salary: double
284
+ something: dynamic
299
285
isLoggedIn:
300
286
type: bool
301
287
default_value: false
302
- roles:
303
- type: array
304
- items:
305
- type: String
306
- birthday:
307
- type: date
308
- addresses:
309
- type: array
310
- items:
311
- type: Address
312
- idToAddress:
313
- type: map
314
- items:
315
- key: String
316
- value: Address
288
+ roles: List<String>
289
+ birthday: date
290
+ addresses: List<Address>
291
+ idToAddress: Map<String, Address>
317
292
securityRole:
318
293
type: String
319
294
jsonKey: securityIndicator
320
- dynamicField:
321
- type: dynamic
295
+ dynamicField: dynamic
322
296
includeIfNullField:
323
297
include_if_null: false #If this field is null, this field will not be added to your json object (used for PATCH models)
324
298
type: String
@@ -335,26 +309,20 @@ UserModel:
335
309
non_final: true #Field will not be marked final
336
310
type: String
337
311
changedAt:
338
- type: datetime
339
- idToAddressList:
340
- type: map
341
- items:
342
- key: String
343
- value: List<Address>
312
+ type: DateTime
313
+ idToAddressList: Map<String, List<Address>>
344
314
345
315
Address:
346
316
path: webservice/user #Can also be package:... and/or end with the actual file (.dart)
347
317
properties:
348
- street:
349
- type: String
318
+ street: String
350
319
351
320
#Custom base_directory
352
321
CustomBaseDirectoryObject:
353
322
base_directory: custom_models
354
323
path: webservice
355
324
properties:
356
- path:
357
- type: String
325
+ path: String
358
326
359
327
#Custom json converter. Use with converters property on models
360
328
DateTimeConverter:
@@ -401,7 +369,7 @@ BookCase:
401
369
properties:
402
370
id: int
403
371
books:
404
- type: List<Book>
372
+ type: List<Book>?
405
373
include_if_null: false
406
374
` ` `
407
375
@@ -563,8 +531,7 @@ UserModel:
563
531
converters :
564
532
- DateTimeConverter
565
533
properties :
566
- changedAt :
567
- type : datetime
534
+ changedAt : DateTime
568
535
` ` `
569
536
570
537
Specify the custom JsonConverter object as a known type to resolve it
@@ -587,8 +554,7 @@ UserModel:
587
554
- DateTimeConverter
588
555
properties:
589
556
description: The time at which the user has last updated his information
590
- changedAt:
591
- type: datetime
557
+ changedAt: DateTime
592
558
` ` `
593
559
594
560
# # Static creator support
@@ -601,8 +567,7 @@ UserModel:
601
567
path: webservice/user
602
568
static_create: true
603
569
properties:
604
- changedAt:
605
- type: datetime
570
+ changedAt: DateTime
606
571
` ` `
607
572
608
573
# # Retrofit compute support
0 commit comments