diff --git a/chopper/test/test_service.chopper.dart b/chopper/test/test_service.chopper.dart index ed9a98ed..c6335821 100644 --- a/chopper/test/test_service.chopper.dart +++ b/chopper/test/test_service.chopper.dart @@ -675,4 +675,30 @@ final class _$HttpTestService extends HttpTestService { ); return client.send($request); } + + @override + Future> publish( + String reviewId, + List negatives, + List positives, [ + String? signature, + ]) { + final Uri $url = Uri.parse('/test/publish'); + final $body = { + 'review_id': reviewId, + 'negatives': negatives, + 'positives': positives, + 'signature': signature, + }; + final Request $request = Request( + 'POST', + $url, + client.baseUrl, + body: $body, + ); + return client.send( + $request, + requestConverter: FormUrlEncodedConverter.requestFactory, + ); + } } diff --git a/chopper/test/test_service.dart b/chopper/test/test_service.dart index ff34b785..6ae6cb4e 100644 --- a/chopper/test/test_service.dart +++ b/chopper/test/test_service.dart @@ -204,6 +204,15 @@ abstract class HttpTestService extends ChopperService { @Header('x-double') double? doubleHeader, @Header('x-enum') ExampleEnum? enumHeader, }); + + @Post(path: 'publish') + @FactoryConverter(request: FormUrlEncodedConverter.requestFactory) + Future> publish( + @Field('review_id') final String reviewId, + @Field() final List negatives, + @Field() final List positives, [ + @Field() final String? signature, + ]); } Request customConvertRequest(Request req) { diff --git a/chopper_generator/lib/src/generator.dart b/chopper_generator/lib/src/generator.dart index a39c1181..f35a341a 100644 --- a/chopper_generator/lib/src/generator.dart +++ b/chopper_generator/lib/src/generator.dart @@ -470,9 +470,7 @@ final class ChopperGenerator // ignore: deprecated_member_use function.enclosingElement is ClassElement // ignore: deprecated_member_use - ? refer(function.enclosingElement!.name!) - .property(function.name!) - .toString() + ? '${function.enclosingElement!.name}.${function.name}' : function.name!; static Map _getAnnotation( diff --git a/chopper_generator/test/test_service.chopper.dart b/chopper_generator/test/test_service.chopper.dart index 16004b15..262dfb11 100644 --- a/chopper_generator/test/test_service.chopper.dart +++ b/chopper_generator/test/test_service.chopper.dart @@ -662,4 +662,30 @@ final class _$HttpTestService extends HttpTestService { ); return client.send($request); } + + @override + Future> publish( + String reviewId, + List negatives, + List positives, [ + String? signature, + ]) { + final Uri $url = Uri.parse('/test/publish'); + final $body = { + 'review_id': reviewId, + 'negatives': negatives, + 'positives': positives, + 'signature': signature, + }; + final Request $request = Request( + 'POST', + $url, + client.baseUrl, + body: $body, + ); + return client.send( + $request, + requestConverter: FormUrlEncodedConverter.requestFactory, + ); + } } diff --git a/chopper_generator/test/test_service.dart b/chopper_generator/test/test_service.dart index 58dce35a..1fae94fc 100644 --- a/chopper_generator/test/test_service.dart +++ b/chopper_generator/test/test_service.dart @@ -197,6 +197,15 @@ abstract class HttpTestService extends ChopperService { @Header('x-double') double? doubleHeader, @Header('x-enum') ExampleEnum? enumHeader, }); + + @Post(path: 'publish') + @FactoryConverter(request: FormUrlEncodedConverter.requestFactory) + Future> publish( + @Field('review_id') final String reviewId, + @Field() final List negatives, + @Field() final List positives, [ + @Field() final String? signature, + ]); } Request customConvertRequest(Request req) {