Skip to content

Commit ce06181

Browse files
committed
#124: updated model generator yaml
1 parent 51f201b commit ce06181

File tree

2 files changed

+19
-30
lines changed

2 files changed

+19
-30
lines changed

example/model_generator/config.yaml

+18-29
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ OGM:
2424
required: true
2525
type: string
2626
securityRole:
27-
type: string
27+
type: string?
2828
jsonKey: securityIndicator
2929
mutableProperty:
30-
type: string
30+
type: string?
3131
non_final: true
3232
dateChange:
33-
type: datetime
33+
type: datetime?
3434
fields:
35-
type: array
36-
items:
37-
type: List<Testing>
35+
type: List<List<Testing>>?
3836
simpleFields: List<Testing>
3937
simpleMap: Map<String, Testing>?
4038

@@ -48,20 +46,20 @@ Testing:
4846
properties:
4947
isFavourite:
5048
ignore: true
51-
type: string
49+
type: string?
5250
structuredMessage:
53-
type: string
51+
type: string?
5452
beneficiary:
5553
required: true
5654
type: string
5755
beneficiaryIBAN:
58-
type: string
56+
type: string?
5957
dynamicField:
60-
type: dynamic
58+
type: dynamic?
6159
duration:
62-
type: Duration
60+
type: Duration?
6361
duration_from_json_test:
64-
type: DurationFromToJson
62+
type: DurationFromToJson?
6563

6664
AdminProfileData:
6765
path: user/profile
@@ -107,23 +105,14 @@ UserProfileData:
107105
type: OGM
108106
offTrack:
109107
include_if_null: false
110-
type: array
111-
items:
112-
type: string
108+
type: List<string>?
113109
onTrack:
114110
include_if_null: true
115-
type: array
116-
items:
117-
type: OGM
111+
type: List<OGM>?
118112
persons:
119-
type: array
120-
items:
121-
type: Person
113+
type: List<Person>?
122114
personsById:
123-
type: map
124-
items:
125-
key: String
126-
value: Person
115+
type: Map<String, Person>?
127116

128117
Person:
129118
path: user/person/
@@ -150,13 +139,13 @@ CustomBaseDirectoryObj:
150139
path: article
151140
properties:
152141
name:
153-
type: string
142+
type: string?
154143

155144
NoCustomBaseDirectoryObj:
156145
path: article
157146
properties:
158147
customBaseDirectoryObj:
159-
type: CustomBaseDirectoryObj
148+
type: CustomBaseDirectoryObj?
160149

161150
DateTimeConverter:
162151
type: json_converter
@@ -173,8 +162,8 @@ Project:
173162
type: string
174163
default_value: "'test'"
175164
cost:
176-
type: double
165+
type: double?
177166
default_value: 0.2
178167
status:
179-
type: Status
168+
type: Status?
180169
unknown_enum_value: STATUS_0

lib/config/yml_generator_config.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ class YmlGeneratorConfig {
366366
}
367367

368368
ItemType _parseSimpleType(String type) {
369-
final listRegex = RegExp(r'^\s*[Ll]ist<\s*([a-zA-Z_0-9]*)\s*>\s*$');
369+
final listRegex = RegExp(r'^\s*[Ll]ist<\s*([a-zA-Z_0-9<>]*)\s*>\s*$');
370370
final mapRegex =
371371
RegExp(r'^\s*[Mm]ap<([a-zA-Z_0-9]*)\s*,\s*([a-zA-Z_0-9]*)\s*>\s*$');
372372

0 commit comments

Comments
 (0)