Open sbatezat opened 5 months ago
@sbatezat will take a look at it in a few hours
@sbatezat Import MediaType manually as a workaround
Thanks, it's working by importing manually http_parser.
import 'package:http_parser/http_parser.dart';
It's a workaround, as you said, so I keep this issue open waiting for a robust fix!
@sbatezat The problem here is that MediaType is not imported by default if you are not using it in the template for the api, since we can't add imports in part files, the only solution I see is to expose http_parser's MediaType through
export 'package:http_parser/http_parser.dart' show MediaType
in http.dart, as that is always imported in template files. Is this acceptable? It would mean an extra dependency.
I don't see any other way we could guarantee the import, but I am not an ace when it comes to working with code_gen
DioMediaType is an Alias of MediaType in the Dio Package. Maybe this is what we should be generating instead. I would expect everyone having Dio as a dependency
Describe the bug Bumping retrofit_generator from 8.1.0 to 8.1.1 leads to a generation error.
To Reproduce Steps to reproduce the behavior:
Expected behavior Generator succeed