Skip to content

Commit

Permalink
chore(dynamite_end_to_end_test): migrate lint rules
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolas Rimikis <[email protected]>
  • Loading branch information
Leptopoda committed Dec 19, 2023
1 parent 5dac43f commit 4064c0e
Show file tree
Hide file tree
Showing 23 changed files with 272 additions and 285 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TypeResultList extends TypeResult {
final String? mimeType,
}) {
if (onlyChildren) {
return '($object as List).map<String>((final e) => ${subType.encode('e', mimeType: mimeType)}).join()';
return '($object as List).map<String>((e) => ${subType.encode('e', mimeType: mimeType)}).join()';
}

return super.encode(object, mimeType: mimeType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
include: package:neon_lints/dart.yaml

linter:
rules:
prefer_final_parameters: true
avoid_final_parameters: false
24 changes: 11 additions & 13 deletions packages/dynamite/dynamite_end_to_end_test/lib/all_of.openapi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Client extends DynamiteClient {
super.cookieJar,
});

Client.fromClient(final DynamiteClient client)
Client.fromClient(DynamiteClient client)
: super(
client.baseURL,
baseHeaders: client.baseHeaders,
Expand All @@ -48,11 +48,11 @@ abstract interface class $ObjectAllOf_1Interface {
abstract interface class $ObjectAllOfInterface implements $ObjectAllOf_0Interface, $ObjectAllOf_1Interface {}

abstract class ObjectAllOf implements $ObjectAllOfInterface, Built<ObjectAllOf, ObjectAllOfBuilder> {
factory ObjectAllOf([final void Function(ObjectAllOfBuilder)? b]) = _$ObjectAllOf;
factory ObjectAllOf([void Function(ObjectAllOfBuilder)? b]) = _$ObjectAllOf;

const ObjectAllOf._();

factory ObjectAllOf.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory ObjectAllOf.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -69,12 +69,11 @@ abstract interface class $OneObjectAllOf_0Interface {
abstract interface class $OneObjectAllOfInterface implements $OneObjectAllOf_0Interface {}

abstract class OneObjectAllOf implements $OneObjectAllOfInterface, Built<OneObjectAllOf, OneObjectAllOfBuilder> {
factory OneObjectAllOf([final void Function(OneObjectAllOfBuilder)? b]) = _$OneObjectAllOf;
factory OneObjectAllOf([void Function(OneObjectAllOfBuilder)? b]) = _$OneObjectAllOf;

const OneObjectAllOf._();

factory OneObjectAllOf.fromJson(final Map<String, dynamic> json) =>
jsonSerializers.deserializeWith(serializer, json)!;
factory OneObjectAllOf.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -90,12 +89,11 @@ abstract interface class $PrimitiveAllOfInterface {
}

abstract class PrimitiveAllOf implements $PrimitiveAllOfInterface, Built<PrimitiveAllOf, PrimitiveAllOfBuilder> {
factory PrimitiveAllOf([final void Function(PrimitiveAllOfBuilder)? b]) = _$PrimitiveAllOf;
factory PrimitiveAllOf([void Function(PrimitiveAllOfBuilder)? b]) = _$PrimitiveAllOf;

const PrimitiveAllOf._();

factory PrimitiveAllOf.fromJson(final Map<String, dynamic> json) =>
jsonSerializers.deserializeWith(serializer, json)!;
factory PrimitiveAllOf.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -115,11 +113,11 @@ abstract interface class $MixedAllOfInterface implements $MixedAllOf_1Interface
}

abstract class MixedAllOf implements $MixedAllOfInterface, Built<MixedAllOf, MixedAllOfBuilder> {
factory MixedAllOf([final void Function(MixedAllOfBuilder)? b]) = _$MixedAllOf;
factory MixedAllOf([void Function(MixedAllOfBuilder)? b]) = _$MixedAllOf;

const MixedAllOf._();

factory MixedAllOf.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory MixedAllOf.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -133,11 +131,11 @@ abstract interface class $OneValueAllOfInterface {
}

abstract class OneValueAllOf implements $OneValueAllOfInterface, Built<OneValueAllOf, OneValueAllOfBuilder> {
factory OneValueAllOf([final void Function(OneValueAllOfBuilder)? b]) = _$OneValueAllOf;
factory OneValueAllOf([void Function(OneValueAllOfBuilder)? b]) = _$OneValueAllOf;

const OneValueAllOf._();

factory OneValueAllOf.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory OneValueAllOf.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand Down
61 changes: 30 additions & 31 deletions packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Client extends DynamiteClient {
super.cookieJar,
});

Client.fromClient(final DynamiteClient client)
Client.fromClient(DynamiteClient client)
: super(
client.baseURL,
baseHeaders: client.baseHeaders,
Expand All @@ -48,11 +48,11 @@ abstract interface class $ObjectAnyOf0Interface {
}

abstract class ObjectAnyOf0 implements $ObjectAnyOf0Interface, Built<ObjectAnyOf0, ObjectAnyOf0Builder> {
factory ObjectAnyOf0([final void Function(ObjectAnyOf0Builder)? b]) = _$ObjectAnyOf0;
factory ObjectAnyOf0([void Function(ObjectAnyOf0Builder)? b]) = _$ObjectAnyOf0;

const ObjectAnyOf0._();

factory ObjectAnyOf0.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory ObjectAnyOf0.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -66,11 +66,11 @@ abstract interface class $ObjectAnyOf1Interface {
}

abstract class ObjectAnyOf1 implements $ObjectAnyOf1Interface, Built<ObjectAnyOf1, ObjectAnyOf1Builder> {
factory ObjectAnyOf1([final void Function(ObjectAnyOf1Builder)? b]) = _$ObjectAnyOf1;
factory ObjectAnyOf1([void Function(ObjectAnyOf1Builder)? b]) = _$ObjectAnyOf1;

const ObjectAnyOf1._();

factory ObjectAnyOf1.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory ObjectAnyOf1.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -84,11 +84,11 @@ abstract interface class $MixedAnyOf1Interface {
}

abstract class MixedAnyOf1 implements $MixedAnyOf1Interface, Built<MixedAnyOf1, MixedAnyOf1Builder> {
factory MixedAnyOf1([final void Function(MixedAnyOf1Builder)? b]) = _$MixedAnyOf1;
factory MixedAnyOf1([void Function(MixedAnyOf1Builder)? b]) = _$MixedAnyOf1;

const MixedAnyOf1._();

factory MixedAnyOf1.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory MixedAnyOf1.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -102,12 +102,11 @@ abstract interface class $OneObjectAnyOf0Interface {
}

abstract class OneObjectAnyOf0 implements $OneObjectAnyOf0Interface, Built<OneObjectAnyOf0, OneObjectAnyOf0Builder> {
factory OneObjectAnyOf0([final void Function(OneObjectAnyOf0Builder)? b]) = _$OneObjectAnyOf0;
factory OneObjectAnyOf0([void Function(OneObjectAnyOf0Builder)? b]) = _$OneObjectAnyOf0;

const OneObjectAnyOf0._();

factory OneObjectAnyOf0.fromJson(final Map<String, dynamic> json) =>
jsonSerializers.deserializeWith(serializer, json)!;
factory OneObjectAnyOf0.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -127,7 +126,7 @@ extension $ObjectAnyOf0ObjectAnyOf1Extension on $ObjectAnyOf0ObjectAnyOf1 {
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<$ObjectAnyOf0ObjectAnyOf1> get serializer => const _$ObjectAnyOf0ObjectAnyOf1Serializer();
static $ObjectAnyOf0ObjectAnyOf1 fromJson(final Object? json) => jsonSerializers.deserializeWith(serializer, json)!;
static $ObjectAnyOf0ObjectAnyOf1 fromJson(Object? json) => jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => jsonSerializers.serializeWith(serializer, this);
}

Expand All @@ -142,9 +141,9 @@ class _$ObjectAnyOf0ObjectAnyOf1Serializer implements PrimitiveSerializer<$Objec

@override
Object serialize(
final Serializers serializers,
final $ObjectAnyOf0ObjectAnyOf1 object, {
final FullType specifiedType = FullType.unspecified,
Serializers serializers,
$ObjectAnyOf0ObjectAnyOf1 object, {
FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.objectAnyOf0;
Expand All @@ -161,9 +160,9 @@ class _$ObjectAnyOf0ObjectAnyOf1Serializer implements PrimitiveSerializer<$Objec

@override
$ObjectAnyOf0ObjectAnyOf1 deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
Serializers serializers,
Object data, {
FullType specifiedType = FullType.unspecified,
}) {
ObjectAnyOf0? objectAnyOf0;
try {
Expand All @@ -184,7 +183,7 @@ extension $MixedAnyOf1StringExtension on $MixedAnyOf1String {
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<$MixedAnyOf1String> get serializer => const _$MixedAnyOf1StringSerializer();
static $MixedAnyOf1String fromJson(final Object? json) => jsonSerializers.deserializeWith(serializer, json)!;
static $MixedAnyOf1String fromJson(Object? json) => jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => jsonSerializers.serializeWith(serializer, this);
}

Expand All @@ -199,9 +198,9 @@ class _$MixedAnyOf1StringSerializer implements PrimitiveSerializer<$MixedAnyOf1S

@override
Object serialize(
final Serializers serializers,
final $MixedAnyOf1String object, {
final FullType specifiedType = FullType.unspecified,
Serializers serializers,
$MixedAnyOf1String object, {
FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.mixedAnyOf1;
Expand All @@ -218,9 +217,9 @@ class _$MixedAnyOf1StringSerializer implements PrimitiveSerializer<$MixedAnyOf1S

@override
$MixedAnyOf1String deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
Serializers serializers,
Object data, {
FullType specifiedType = FullType.unspecified,
}) {
MixedAnyOf1? mixedAnyOf1;
try {
Expand All @@ -241,7 +240,7 @@ extension $NumStringExtension on $NumString {
void validateOneOf() => dynamite_utils.validateOneOf(_values);
void validateAnyOf() => dynamite_utils.validateAnyOf(_values);
static Serializer<$NumString> get serializer => const _$NumStringSerializer();
static $NumString fromJson(final Object? json) => jsonSerializers.deserializeWith(serializer, json)!;
static $NumString fromJson(Object? json) => jsonSerializers.deserializeWith(serializer, json)!;
Object? toJson() => jsonSerializers.serializeWith(serializer, this);
}

Expand All @@ -256,9 +255,9 @@ class _$NumStringSerializer implements PrimitiveSerializer<$NumString> {

@override
Object serialize(
final Serializers serializers,
final $NumString object, {
final FullType specifiedType = FullType.unspecified,
Serializers serializers,
$NumString object, {
FullType specifiedType = FullType.unspecified,
}) {
dynamic value;
value = object.$num;
Expand All @@ -275,9 +274,9 @@ class _$NumStringSerializer implements PrimitiveSerializer<$NumString> {

@override
$NumString deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
Serializers serializers,
Object data, {
FullType specifiedType = FullType.unspecified,
}) {
num? $num;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Client extends DynamiteClient {
super.cookieJar,
});

Client.fromClient(final DynamiteClient client)
Client.fromClient(DynamiteClient client)
: super(
client.baseURL,
baseHeaders: client.baseHeaders,
Expand All @@ -43,7 +43,7 @@ class EnumString extends EnumClass {

static BuiltSet<EnumString> get values => _$enumStringValues;

static EnumString valueOf(final String name) => _$valueOfEnumString(name);
static EnumString valueOf(String name) => _$valueOfEnumString(name);

static Serializer<EnumString> get serializer => _$enumStringSerializer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Client extends DynamiteClient {
super.cookieJar,
});

Client.fromClient(final DynamiteClient client)
Client.fromClient(DynamiteClient client)
: super(
client.baseURL,
baseHeaders: client.baseHeaders,
Expand Down Expand Up @@ -179,11 +179,11 @@ abstract interface class $GetHeadersInterface {
}

abstract class GetHeaders implements $GetHeadersInterface, Built<GetHeaders, GetHeadersBuilder> {
factory GetHeaders([final void Function(GetHeadersBuilder)? b]) = _$GetHeaders;
factory GetHeaders([void Function(GetHeadersBuilder)? b]) = _$GetHeaders;

const GetHeaders._();

factory GetHeaders.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory GetHeaders.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -200,12 +200,12 @@ abstract class WithContentOperationIdHeaders
implements
$WithContentOperationIdHeadersInterface,
Built<WithContentOperationIdHeaders, WithContentOperationIdHeadersBuilder> {
factory WithContentOperationIdHeaders([final void Function(WithContentOperationIdHeadersBuilder)? b]) =
factory WithContentOperationIdHeaders([void Function(WithContentOperationIdHeadersBuilder)? b]) =
_$WithContentOperationIdHeaders;

const WithContentOperationIdHeaders._();

factory WithContentOperationIdHeaders.fromJson(final Map<String, dynamic> json) =>
factory WithContentOperationIdHeaders.fromJson(Map<String, dynamic> json) =>
jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
Expand All @@ -221,11 +221,11 @@ abstract interface class $GetWithContentHeadersInterface {

abstract class GetWithContentHeaders
implements $GetWithContentHeadersInterface, Built<GetWithContentHeaders, GetWithContentHeadersBuilder> {
factory GetWithContentHeaders([final void Function(GetWithContentHeadersBuilder)? b]) = _$GetWithContentHeaders;
factory GetWithContentHeaders([void Function(GetWithContentHeadersBuilder)? b]) = _$GetWithContentHeaders;

const GetWithContentHeaders._();

factory GetWithContentHeaders.fromJson(final Map<String, dynamic> json) =>
factory GetWithContentHeaders.fromJson(Map<String, dynamic> json) =>
jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Client extends DynamiteClient {
super.cookieJar,
});

Client.fromClient(final DynamiteClient client)
Client.fromClient(DynamiteClient client)
: super(
client.baseURL,
baseHeaders: client.baseHeaders,
Expand All @@ -38,11 +38,11 @@ abstract interface class $BaseInterface {
}

abstract class Base implements $BaseInterface, Built<Base, BaseBuilder> {
factory Base([final void Function(BaseBuilder)? b]) = _$Base;
factory Base([void Function(BaseBuilder)? b]) = _$Base;

const Base._();

factory Base.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory Base.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand All @@ -55,11 +55,11 @@ abstract interface class $BaseInterfaceInterface {
}

abstract class BaseInterface implements $BaseInterfaceInterface, Built<BaseInterface, BaseInterfaceBuilder> {
factory BaseInterface([final void Function(BaseInterfaceBuilder)? b]) = _$BaseInterface;
factory BaseInterface([void Function(BaseInterfaceBuilder)? b]) = _$BaseInterface;

const BaseInterface._();

factory BaseInterface.fromJson(final Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;
factory BaseInterface.fromJson(Map<String, dynamic> json) => jsonSerializers.deserializeWith(serializer, json)!;

Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;

Expand Down
Loading

0 comments on commit 4064c0e

Please sign in to comment.