Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AdditionalProperties enumUnknownDefaultCase #119

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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