Skip to content
Open
Show file tree
Hide file tree
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 @@ -163,7 +163,7 @@ class {{{classname}}} {
: {{items.complexType}}.mapListFromJson(json[r'{{{baseName}}}']),
{{/items.complexType}}
{{^items.complexType}}
: mapCastOfType<String, List>(json, r'{{{baseName}}}'),
: (json[r'{{{baseName}}}'] as Map<String, dynamic>).map((k, v) => MapEntry(k, v == null ? {{#items.isNullable}}null{{/items.isNullable}}{{^items.isNullable}}const <{{items.items.dataType}}>[]{{/items.isNullable}} : (v as List).cast<{{items.items.dataType}}>())),
{{/items.complexType}}
{{/items.isArray}}
{{^items.isArray}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,12 @@ components:
type: object
additionalProperties:
type: string
map_of_array_integer:
type: object
additionalProperties:
type: array
items:
type: integer
MixedPropertiesAndAdditionalPropertiesClass:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapProperty** | **Map<String, String>** | | [optional] [default to const {}]
**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] [default to const {}]
**mapOfArrayInteger** | [**Map<String, List<int>>**](List.md) | | [optional] [default to const {}]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,36 @@ class AdditionalPropertiesClass {
AdditionalPropertiesClass({
this.mapProperty = const {},
this.mapOfMapProperty = const {},
this.mapOfArrayInteger = const {},
});

Map<String, String> mapProperty;

Map<String, Map<String, String>> mapOfMapProperty;

Map<String, List<int>> mapOfArrayInteger;

@override
bool operator ==(Object other) => identical(this, other) || other is AdditionalPropertiesClass &&
_deepEquality.equals(other.mapProperty, mapProperty) &&
_deepEquality.equals(other.mapOfMapProperty, mapOfMapProperty);
_deepEquality.equals(other.mapOfMapProperty, mapOfMapProperty) &&
_deepEquality.equals(other.mapOfArrayInteger, mapOfArrayInteger);

@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(mapProperty.hashCode) +
(mapOfMapProperty.hashCode);
(mapOfMapProperty.hashCode) +
(mapOfArrayInteger.hashCode);

@override
String toString() => 'AdditionalPropertiesClass[mapProperty=$mapProperty, mapOfMapProperty=$mapOfMapProperty]';
String toString() => 'AdditionalPropertiesClass[mapProperty=$mapProperty, mapOfMapProperty=$mapOfMapProperty, mapOfArrayInteger=$mapOfArrayInteger]';

Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'map_property'] = this.mapProperty;
json[r'map_of_map_property'] = this.mapOfMapProperty;
json[r'map_of_array_integer'] = this.mapOfArrayInteger;
return json;
}

Expand All @@ -63,6 +69,9 @@ class AdditionalPropertiesClass {
return AdditionalPropertiesClass(
mapProperty: mapCastOfType<String, String>(json, r'map_property') ?? const {},
mapOfMapProperty: mapCastOfType<String, dynamic>(json, r'map_of_map_property') ?? const {},
mapOfArrayInteger: json[r'map_of_array_integer'] == null
? const {}
: (json[r'map_of_array_integer'] as Map<String, dynamic>).map((k, v) => MapEntry(k, v == null ? const <int>[] : (v as List).cast<int>())),
);
}
return null;
Expand Down