|
|
@ -810,24 +810,20 @@ class OpenAPIBuilder implements Builder { |
|
|
|
), |
|
|
|
), |
|
|
|
mediaType.schema!, |
|
|
|
mediaType.schema!, |
|
|
|
); |
|
|
|
); |
|
|
|
switch (mimeType) { |
|
|
|
if (mimeType == '*/*' || mimeType.startsWith('image/')) { |
|
|
|
case 'application/json': |
|
|
|
dataType = 'Uint8List'; |
|
|
|
|
|
|
|
dataValue = 'response.body'; |
|
|
|
|
|
|
|
} else if (mimeType.startsWith('text/')) { |
|
|
|
|
|
|
|
dataType = 'String'; |
|
|
|
|
|
|
|
dataValue = 'utf8.decode(response.body)'; |
|
|
|
|
|
|
|
} else if (mimeType == 'application/json') { |
|
|
|
dataType = result.name; |
|
|
|
dataType = result.name; |
|
|
|
if (result.name == 'dynamic') { |
|
|
|
if (result.name == 'dynamic') { |
|
|
|
dataValue = ''; |
|
|
|
dataValue = ''; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
dataValue = result.deserialize(result.decode('utf8.decode(response.body)')); |
|
|
|
dataValue = result.deserialize(result.decode('utf8.decode(response.body)')); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
} else { |
|
|
|
case 'image/png': |
|
|
|
|
|
|
|
dataType = 'Uint8List'; |
|
|
|
|
|
|
|
dataValue = 'response.body'; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'text/plain': |
|
|
|
|
|
|
|
dataType = 'String'; |
|
|
|
|
|
|
|
dataValue = 'utf8.decode(response.body)'; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
throw Exception('Can not parse mime type "$mimeType"'); |
|
|
|
throw Exception('Can not parse mime type "$mimeType"'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|