Browse Source

dynamite: Fix complex response prefixes

pull/168/head
jld3103 2 years ago
parent
commit
d6be5d0912
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 6
      packages/dynamite/lib/src/openapi_builder.dart

6
packages/dynamite/lib/src/openapi_builder.dart

@ -792,8 +792,10 @@ class OpenAPIBuilder implements Builder {
} }
if (headersType != null && dataType != null) { if (headersType != null && dataType != null) {
b.returns = refer('Future<Response<$dataType, $headersType>>'); b.returns = refer('Future<${prefix}Response<$dataType, $headersType>>');
code.write('return Response<$dataType, $headersType>($dataValue, $headersValue,);'); code.write(
'return ${prefix}Response<$dataType, $headersType>($dataValue, $headersValue,);',
);
} else if (headersType != null) { } else if (headersType != null) {
b.returns = refer('Future<$headersType>'); b.returns = refer('Future<$headersType>');
code.write('return $headersValue;'); code.write('return $headersValue;');

Loading…
Cancel
Save