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&lt;String, String&gt;** | | [optional]
**mapOfMapProperty** | [**Map&lt;String, Map&lt;String, String&gt;&gt;**](Map.md) | | [optional]
**mapOfArrayInteger** | [**Map&lt;String, List&lt;int&gt;&gt;**](List.md) | | [optional]

[[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 @@ -23,6 +23,8 @@ class AdditionalPropertiesClass {
this.mapProperty,

this.mapOfMapProperty,

this.mapOfArrayInteger,
});

@JsonKey(
Expand All @@ -49,17 +51,31 @@ class AdditionalPropertiesClass {



@JsonKey(

name: r'map_of_array_integer',
required: false,
includeIfNull: false,
)


final Map<String, List<int>>? mapOfArrayInteger;





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

@override
int get hashCode =>
mapProperty.hashCode +
mapOfMapProperty.hashCode;
mapOfMapProperty.hashCode +
mapOfArrayInteger.hashCode;

factory AdditionalPropertiesClass.fromJson(Map<String, dynamic> json) => _$AdditionalPropertiesClassFromJson(json);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapProperty** | **BuiltMap&lt;String, String&gt;** | | [optional]
**mapOfMapProperty** | [**BuiltMap&lt;String, BuiltMap&lt;String, String&gt;&gt;**](BuiltMap.md) | | [optional]
**mapOfArrayInteger** | [**BuiltMap&lt;String, BuiltList&lt;int&gt;&gt;**](BuiltList.md) | | [optional]

[[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 @@ -14,6 +14,7 @@ part 'additional_properties_class.g.dart';
/// Properties:
/// * [mapProperty]
/// * [mapOfMapProperty]
/// * [mapOfArrayInteger]
@BuiltValue()
abstract class AdditionalPropertiesClass implements Built<AdditionalPropertiesClass, AdditionalPropertiesClassBuilder> {
@BuiltValueField(wireName: r'map_property')
Expand All @@ -22,6 +23,9 @@ abstract class AdditionalPropertiesClass implements Built<AdditionalPropertiesCl
@BuiltValueField(wireName: r'map_of_map_property')
BuiltMap<String, BuiltMap<String, String>>? get mapOfMapProperty;

@BuiltValueField(wireName: r'map_of_array_integer')
BuiltMap<String, BuiltList<int>>? get mapOfArrayInteger;

AdditionalPropertiesClass._();

factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass;
Expand Down Expand Up @@ -59,6 +63,13 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer<Addit
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]),
);
}
if (object.mapOfArrayInteger != null) {
yield r'map_of_array_integer';
yield serializers.serialize(
object.mapOfArrayInteger,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltList, [FullType(int)])]),
);
}
}

@override
Expand Down Expand Up @@ -96,6 +107,13 @@ class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer<Addit
) as BuiltMap<String, BuiltMap<String, String>>;
result.mapOfMapProperty.replace(valueDes);
break;
case r'map_of_array_integer':
final valueDes = serializers.deserialize(
value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltList, [FullType(int)])]),
) as BuiltMap<String, BuiltList<int>>;
result.mapOfArrayInteger.replace(valueDes);
break;
default:
unhandled.add(key);
unhandled.add(value);
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