From d6be5d0912553254b24849e171262e4ab46d4bf6 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 21 Dec 2022 10:37:51 +0100 Subject: [PATCH] dynamite: Fix complex response prefixes --- packages/dynamite/lib/src/openapi_builder.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index 3682aba4..a5d8a17c 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -792,8 +792,10 @@ class OpenAPIBuilder implements Builder { } if (headersType != null && dataType != null) { - b.returns = refer('Future>'); - code.write('return Response<$dataType, $headersType>($dataValue, $headersValue,);'); + b.returns = refer('Future<${prefix}Response<$dataType, $headersType>>'); + code.write( + 'return ${prefix}Response<$dataType, $headersType>($dataValue, $headersValue,);', + ); } else if (headersType != null) { b.returns = refer('Future<$headersType>'); code.write('return $headersValue;');