Skip to content

Commit c4aa333

Browse files
committed
#124: updated readme
1 parent 37d1ce0 commit c4aa333

File tree

1 file changed

+24
-59
lines changed

1 file changed

+24
-59
lines changed

README.md

Lines changed: 24 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ UserModel:
6969
path: webservice/user
7070
equals_and_hash_code: false
7171
properties:
72-
id:
73-
type: int
72+
id: int
7473
```
7574

7675
### Ignored fields
@@ -87,8 +86,7 @@ UserModel:
8786
id:
8887
type: int
8988
ignore_equality: true
90-
include:
91-
type: String
89+
include: String
9290
```
9391

9492
## explicit_to_json
@@ -108,8 +106,7 @@ UserModel:
108106
path: webservice/user
109107
explicit_to_json: false
110108
properties:
111-
id:
112-
type: int
109+
id: int
113110
```
114111

115112
## toString
@@ -129,8 +126,7 @@ UserModel:
129126
path: webservice/user
130127
to_string: false
131128
properties:
132-
id:
133-
type: int
129+
id: int
134130
```
135131

136132
## Extra imports and annotations
@@ -154,8 +150,7 @@ UserModel:
154150
extra_annotations:
155151
- '@someAnnotation'
156152
properties:
157-
id:
158-
type: int
153+
id: int
159154
```
160155

161156
## Default values
@@ -178,7 +173,6 @@ UserModel:
178173
default_value: 1
179174
name:
180175
type: String
181-
required: true
182176
default_value: "'an example quoted string'"
183177
```
184178

@@ -208,7 +202,6 @@ UserModel:
208202
default_value: 1
209203
name:
210204
type: String
211-
required: true
212205
default_value: "'an example quoted string'"
213206
```
214207

@@ -223,7 +216,6 @@ UserModel:
223216
default_value: 1
224217
name:
225218
type: String
226-
required: true
227219
default_value: "'an example quoted string'"
228220
disallow_null: true
229221
```
@@ -246,8 +238,7 @@ UserModel:
246238
converters:
247239
- DateTimeConverter
248240
properties:
249-
id:
250-
type: int
241+
id: int
251242
```
252243

253244
## Extends
@@ -261,8 +252,7 @@ UserDetails:
261252
path: webservice/user
262253
extends: UserModel
263254
properties:
264-
name:
265-
type: String
255+
name: String
266256
```
267257

268258
## Builtin types
@@ -288,37 +278,21 @@ UserModel:
288278
converters:
289279
- DateTimeConverter
290280
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
299285
isLoggedIn:
300286
type: bool
301287
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>
317292
securityRole:
318293
type: String
319294
jsonKey: securityIndicator
320-
dynamicField:
321-
type: dynamic
295+
dynamicField: dynamic
322296
includeIfNullField:
323297
include_if_null: false #If this field is null, this field will not be added to your json object (used for PATCH models)
324298
type: String
@@ -335,26 +309,20 @@ UserModel:
335309
non_final: true #Field will not be marked final
336310
type: String
337311
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>>
344314
345315
Address:
346316
path: webservice/user #Can also be package:... and/or end with the actual file (.dart)
347317
properties:
348-
street:
349-
type: String
318+
street: String
350319
351320
#Custom base_directory
352321
CustomBaseDirectoryObject:
353322
base_directory: custom_models
354323
path: webservice
355324
properties:
356-
path:
357-
type: String
325+
path: String
358326
359327
#Custom json converter. Use with converters property on models
360328
DateTimeConverter:
@@ -401,7 +369,7 @@ BookCase:
401369
properties:
402370
id: int
403371
books:
404-
type: List<Book>
372+
type: List<Book>?
405373
include_if_null: false
406374
```
407375

@@ -563,8 +531,7 @@ UserModel:
563531
converters:
564532
- DateTimeConverter
565533
properties:
566-
changedAt:
567-
type: datetime
534+
changedAt: DateTime
568535
```
569536
570537
Specify the custom JsonConverter object as a known type to resolve it
@@ -587,8 +554,7 @@ UserModel:
587554
- DateTimeConverter
588555
properties:
589556
description: The time at which the user has last updated his information
590-
changedAt:
591-
type: datetime
557+
changedAt: DateTime
592558
```
593559

594560
## Static creator support
@@ -601,8 +567,7 @@ UserModel:
601567
path: webservice/user
602568
static_create: true
603569
properties:
604-
changedAt:
605-
type: datetime
570+
changedAt: DateTime
606571
```
607572

608573
## Retrofit compute support

0 commit comments

Comments
 (0)