Skip to content

Commit

Permalink
Merge pull request #119 from noncheat/main
Browse files Browse the repository at this point in the history
fix: added unknown_default_open_api support
  • Loading branch information
gibahjoe authored Jan 15, 2024
2 parents 945caf4 + 1392334 commit a95675f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ class AdditionalProperties {
/// Allow the 'x-enum-values' extension for enums
final bool? useEnumExtension;

/// With this option enabled, each enum will have a new case, 'unknown_default_open_api',
/// so that when the server sends an enum case that is not known by the client/spec,
/// they can safely fallback to this case
final bool? enumUnknownDefaultCase;

/// Flutter wrapper to use (none|flutterw|fvm)
final Wrapper wrapper;

Expand All @@ -399,6 +404,7 @@ class AdditionalProperties {
this.allowUnicodeIdentifiers = false,
this.ensureUniqueParams = true,
this.useEnumExtension = false,
this.enumUnknownDefaultCase = true,
this.prependFormOrBodyParameters = false,
this.pubAuthor,
this.pubAuthorEmail,
Expand All @@ -419,6 +425,7 @@ class AdditionalProperties {
allowUnicodeIdentifiers: map['allowUnicodeIdentifiers'] ?? false,
ensureUniqueParams: map['ensureUniqueParams'] ?? true,
useEnumExtension: map['useEnumExtension'] ?? true,
enumUnknownDefaultCase: map['enumUnknownDefaultCase'] ?? true,
prependFormOrBodyParameters:
map['prependFormOrBodyParameters'] ?? false,
pubAuthor: map['pubAuthor'],
Expand All @@ -440,6 +447,7 @@ class AdditionalProperties {
'allowUnicodeIdentifiers': allowUnicodeIdentifiers,
'ensureUniqueParams': ensureUniqueParams,
'useEnumExtension': useEnumExtension,
'enumUnknownDefaultCase': enumUnknownDefaultCase,
'prependFormOrBodyParameters': prependFormOrBodyParameters,
if (pubAuthor != null) 'pubAuthor': pubAuthor,
if (pubAuthorEmail != null) 'pubAuthorEmail': pubAuthorEmail,
Expand Down Expand Up @@ -524,6 +532,7 @@ class DioProperties extends AdditionalProperties {
bool sortModelPropertiesByRequiredFlag = true,
bool sortParamsByRequiredFlag = true,
bool useEnumExtension = true,
bool enumUnknownDefaultCase = true,
String? sourceFolder,
Wrapper wrapper = Wrapper.none})
: super(
Expand All @@ -541,6 +550,7 @@ class DioProperties extends AdditionalProperties {
sortParamsByRequiredFlag: sortParamsByRequiredFlag,
sourceFolder: sourceFolder,
useEnumExtension: useEnumExtension,
enumUnknownDefaultCase: enumUnknownDefaultCase,
wrapper: wrapper);

DioProperties.fromMap(Map<String, dynamic> map)
Expand Down Expand Up @@ -599,6 +609,7 @@ class DioAltProperties extends AdditionalProperties {
bool sortModelPropertiesByRequiredFlag = true,
bool sortParamsByRequiredFlag = true,
bool useEnumExtension = true,
bool enumUnknownDefaultCase = true,
String? sourceFolder,
Wrapper wrapper = Wrapper.none})
: super(
Expand All @@ -616,6 +627,7 @@ class DioAltProperties extends AdditionalProperties {
sortParamsByRequiredFlag: sortParamsByRequiredFlag,
sourceFolder: sourceFolder,
useEnumExtension: useEnumExtension,
enumUnknownDefaultCase: enumUnknownDefaultCase,
wrapper: wrapper);

DioAltProperties.fromMap(Map<String, dynamic> map)
Expand Down

0 comments on commit a95675f

Please sign in to comment.