@@ -4,12 +4,6 @@ import 'dart:io';
4
4
import 'package:crypto/crypto.dart' ;
5
5
import 'package:meta/meta.dart' ;
6
6
7
- /// Config base class
8
- /// Your annotated class must extend this config class
9
- @Deprecated (
10
- 'You do not need to extend this anymore (See example). This class would be removed in the next major release.' )
11
- abstract class OpenapiGeneratorConfig {}
12
-
13
7
class Openapi {
14
8
/// Additional properties to pass to the compiler (CSV)
15
9
///
@@ -26,12 +20,6 @@ class Openapi {
26
20
/// --api-package
27
21
final String ? apiPackage;
28
22
29
- /// relative path or url to spec file
30
- ///
31
- /// -i
32
- @Deprecated ('To be removed in the next major' )
33
- final String inputSpecFile;
34
-
35
23
/// Provides the access information to the input spec file.
36
24
///
37
25
/// For use with useNextGen.
@@ -43,7 +31,7 @@ class Openapi {
43
31
/// to be applied to the fetch request when the spec file is in a remote
44
32
/// location. There is also special handling for when the spec file lives within
45
33
/// AWS.
46
- final InputSpec ? inputSpec;
34
+ final InputSpec inputSpec;
47
35
48
36
/// folder containing the template files
49
37
///
@@ -80,12 +68,6 @@ class Openapi {
80
68
/// --reserved-words-mappings
81
69
final Map <String , String >? reservedWordsMappings;
82
70
83
- /// Tells openapi-generator to always run during the build process
84
- /// if set to false (the default), openapi-generator will skip processing if the [outputDirectory] already exists
85
- @Deprecated (
86
- 'The generator will always run to determine if there are changes made on the input spec file' )
87
- final bool ? alwaysRun;
88
-
89
71
/// if set to true, flutter pub get will be run on the [outputDirectory] after the code has been generated.
90
72
/// Defaults to true for backwards compatibility
91
73
final bool ? fetchDependencies;
@@ -122,21 +104,6 @@ class Openapi {
122
104
/// e.g {'inline_object_2': 'SomethingMapped'}
123
105
final Map <String , String >? inlineSchemaNameMappings;
124
106
125
- /// Use the next generation of the generator.
126
- ///
127
- /// This annotation informs the generator to use the new generator pathway.
128
- /// Enabling this option allows for incremental changes to the [inputSpecFile]
129
- /// to be generated even though the annotation was unchanged.
130
- ///
131
- /// Due to some limitations with build_runner and it only running when the
132
- /// asset graph has changed, a generated line get injected at the beginning of
133
- /// the file at the end of each run.
134
- ///
135
- /// This will become the default behaviour in the next Major version (v5).
136
- ///
137
- /// Default: false
138
- final bool useNextGen;
139
-
140
107
/// The path where to store the cached copy of the specification.
141
108
///
142
109
/// For use with [useNextGen] .
@@ -152,8 +119,7 @@ class Openapi {
152
119
this .additionalProperties,
153
120
this .overwriteExistingFiles,
154
121
this .skipSpecValidation = false ,
155
- @Deprecated ('To be removed in the next major' ) required this .inputSpecFile,
156
- this .inputSpec,
122
+ required this .inputSpec,
157
123
this .templateDirectory,
158
124
required this .generatorName,
159
125
this .outputDirectory,
@@ -165,9 +131,7 @@ class Openapi {
165
131
this .apiPackage,
166
132
this .fetchDependencies = true ,
167
133
this .runSourceGenOnOutput = true ,
168
- this .alwaysRun = false ,
169
134
this .cachePath,
170
- this .useNextGen = false ,
171
135
this .projectPubspecPath,
172
136
this .debugLogging = false ,
173
137
});
@@ -365,10 +329,13 @@ class AdditionalProperties {
365
329
/// Allow the 'x-enum-values' extension for enums
366
330
final bool ? useEnumExtension;
367
331
368
- /// With this option enabled, each enum will have a new case, 'unknown_default_open_api',
332
+ /// If the server adds new enum cases, that are unknown by an old spec/client,
333
+ /// the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api',
369
334
/// so that when the server sends an enum case that is not known by the client/spec,
370
- /// they can safely fallback to this case
371
- final bool ? enumUnknownDefaultCase;
335
+ /// they can safely fallback to this case.
336
+ ///
337
+ /// Default: false
338
+ final bool enumUnknownDefaultCase;
372
339
373
340
/// Flutter wrapper to use (none|flutterw|fvm)
374
341
final Wrapper wrapper;
@@ -392,7 +359,7 @@ class AdditionalProperties {
392
359
this .allowUnicodeIdentifiers = false ,
393
360
this .ensureUniqueParams = true ,
394
361
this .useEnumExtension = false ,
395
- this .enumUnknownDefaultCase = true ,
362
+ this .enumUnknownDefaultCase = false ,
396
363
this .prependFormOrBodyParameters = false ,
397
364
this .pubAuthor,
398
365
this .pubAuthorEmail,
@@ -413,7 +380,7 @@ class AdditionalProperties {
413
380
allowUnicodeIdentifiers: map['allowUnicodeIdentifiers' ] ?? false ,
414
381
ensureUniqueParams: map['ensureUniqueParams' ] ?? true ,
415
382
useEnumExtension: map['useEnumExtension' ] ?? true ,
416
- enumUnknownDefaultCase: map['enumUnknownDefaultCase' ] ?? true ,
383
+ enumUnknownDefaultCase: map['enumUnknownDefaultCase' ] ?? false ,
417
384
prependFormOrBodyParameters:
418
385
map['prependFormOrBodyParameters' ] ?? false ,
419
386
pubAuthor: map['pubAuthor' ],
@@ -520,7 +487,7 @@ class DioProperties extends AdditionalProperties {
520
487
bool sortModelPropertiesByRequiredFlag = true ,
521
488
bool sortParamsByRequiredFlag = true ,
522
489
bool useEnumExtension = true ,
523
- bool enumUnknownDefaultCase = true ,
490
+ bool enumUnknownDefaultCase = false ,
524
491
String ? sourceFolder,
525
492
Wrapper wrapper = Wrapper .none})
526
493
: super (
@@ -597,7 +564,7 @@ class DioAltProperties extends AdditionalProperties {
597
564
bool sortModelPropertiesByRequiredFlag = true ,
598
565
bool sortParamsByRequiredFlag = true ,
599
566
bool useEnumExtension = true ,
600
- bool enumUnknownDefaultCase = true ,
567
+ bool enumUnknownDefaultCase = false ,
601
568
String ? sourceFolder,
602
569
Wrapper wrapper = Wrapper .none})
603
570
: super (
0 commit comments