Commit 917bac4 1 parent 688bba7 commit 917bac4 Copy full SHA for 917bac4
File tree 1 file changed +8
-14
lines changed
packages/dynamite/dynamite/lib/src/builder
1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -48,27 +48,21 @@ void resolveMimeTypeEncode(
48
48
output.writeln ("_request.headers['Content-Type'] = '$mimeType ';" );
49
49
final parameterName = toDartName (result.name);
50
50
51
+ if (result.nullable) {
52
+ output.writeln ('if ($parameterName != null) {' );
53
+ }
54
+
51
55
switch (mimeType) {
52
56
case 'application/json' :
53
57
case 'application/x-www-form-urlencoded' :
54
- if (result.nullable) {
55
- output.writeln ('if ($parameterName != null) {' );
56
- }
57
58
output.writeln ('_request.body = ${result .encode (parameterName , mimeType : mimeType )};' );
58
- if (result.nullable) {
59
- output.writeln ('}' );
60
- }
61
- return ;
62
59
case 'application/octet-stream' :
63
- if (result.nullable) {
64
- output.writeln ('if ($parameterName != null) {' );
65
- }
66
60
output.writeln ('_request.bodyBytes = ${result .encode (parameterName , mimeType : mimeType )};' );
67
- if (result.nullable) {
68
- output.writeln ('}' );
69
- }
70
- return ;
71
61
case _:
72
62
throw Exception ('Can not parse any mime type of the Operation.' );
73
63
}
64
+
65
+ if (result.nullable) {
66
+ output.writeln ('}' );
67
+ }
74
68
}
You can’t perform that action at this time.
0 commit comments