@@ -8,6 +8,11 @@ class Openapi {
8
8
/// --additional-properties
9
9
final AdditionalProperties additionalProperties;
10
10
11
+ /// The package of the api. defaults to lib.api
12
+ ///
13
+ /// --api-package
14
+ final String apiPackage;
15
+
11
16
/// relative path or url to spec file
12
17
///
13
18
/// -i
@@ -21,7 +26,7 @@ class Openapi {
21
26
/// Generator to use (dart|dart2-api|dart-jaguar|dart-dio)
22
27
///
23
28
/// -g, --generator-name
24
- final String generatorName;
29
+ final Generator generatorName;
25
30
26
31
/// Where to write the generated files (current dir by default)
27
32
///
@@ -36,20 +41,24 @@ class Openapi {
36
41
/// Skips the default behavior of validating an input specification.
37
42
///
38
43
/// --skip-validate-spec
39
- final bool skipValidateSpec ;
44
+ final bool skipSpecValidation ;
40
45
41
46
/// Tells openapi-generator to always run during the build process
42
47
/// if set to false (the default), openapi-generator will skip processing if the [outputDirectory] already exists
43
48
final bool alwaysRun;
44
49
50
+ final Map <String , String > typeMappings;
51
+
45
52
const Openapi (
46
53
{this .additionalProperties,
47
54
this .overwriteExistingFiles,
48
- this .skipValidateSpec = false ,
55
+ this .skipSpecValidation = false ,
49
56
this .inputSpecFile,
50
57
this .templateDirectory,
51
58
this .generatorName,
52
59
this .outputDirectory,
60
+ this .typeMappings,
61
+ this .apiPackage,
53
62
this .alwaysRun = false });
54
63
}
55
64
@@ -109,11 +118,14 @@ class AdditionalProperties {
109
118
this .sourceFolder});
110
119
}
111
120
112
- class DartJaguarConfig extends AdditionalProperties {
113
- final String serialization;
121
+ class JaguarProperties extends AdditionalProperties {
122
+ /// Choose serialization format JSON or PROTO is supported
123
+ final SerializationFormat serialization;
124
+
125
+ /// Is the null fields should be in the JSON payload
114
126
final bool nullableFields;
115
127
116
- const DartJaguarConfig (
128
+ const JaguarProperties (
117
129
{this .serialization,
118
130
this .nullableFields,
119
131
bool allowUnicodeIdentifiers = false ,
@@ -144,3 +156,46 @@ class DartJaguarConfig extends AdditionalProperties {
144
156
sourceFolder: sourceFolder,
145
157
useEnumExtension: useEnumExtension);
146
158
}
159
+
160
+ class DioProperties extends AdditionalProperties {
161
+ /// Choose serialization format JSON or PROTO is supported
162
+ final DioDateLibrary dateLibrary;
163
+
164
+ /// Is the null fields should be in the JSON payload
165
+ final bool nullableFields;
166
+
167
+ const DioProperties (
168
+ {this .dateLibrary,
169
+ this .nullableFields,
170
+ bool allowUnicodeIdentifiers = false ,
171
+ bool ensureUniqueParams = true ,
172
+ bool prependFormOrBodyParameters = false ,
173
+ String pubAuthor,
174
+ String pubAuthorEmail,
175
+ String pubDescription,
176
+ String pubHomepage,
177
+ String pubName,
178
+ String pubVersion,
179
+ bool sortModelPropertiesByRequiredFlag = true ,
180
+ bool sortParamsByRequiredFlag = true ,
181
+ bool useEnumExtension = true ,
182
+ String sourceFolder})
183
+ : super (
184
+ allowUnicodeIdentifiers: allowUnicodeIdentifiers,
185
+ ensureUniqueParams: ensureUniqueParams,
186
+ prependFormOrBodyParameters: prependFormOrBodyParameters,
187
+ pubAuthor: pubAuthor,
188
+ pubAuthorEmail: pubAuthorEmail,
189
+ pubDescription: pubDescription,
190
+ pubHomepage: pubHomepage,
191
+ pubVersion: pubVersion,
192
+ sortModelPropertiesByRequiredFlag:
193
+ sortModelPropertiesByRequiredFlag,
194
+ sortParamsByRequiredFlag: sortParamsByRequiredFlag,
195
+ sourceFolder: sourceFolder,
196
+ useEnumExtension: useEnumExtension);
197
+ }
198
+ enum DioDateLibrary { core, timemachine }
199
+ enum SerializationFormat { JSON , PROTO }
200
+ /// The name of the generator to use
201
+ enum Generator { DART , DART_DIO , DART2_API , DART_JAGUAR }
0 commit comments