epam-cross-platform-lab / swagger-dart-code-generator

Swagger/OpenAPI code generator based on Chopper and JsonAnnotation for Flutter
Apache License 2.0
266 stars 124 forks source link

Unsupported generated import in client_mapping.dart #167

Closed mzdm closed 3 years ago

mzdm commented 3 years ago

Swagger/Json file example: https://cloud.ibm.com/apidocs/visual-recognition/visual-recognition-v3.json -> this has name visual-recognition-visual-recognition-v3.swagger

When running the generator, client_mapping.dart generates import:

import 'visual-recognition-visual-recognition-v3.swagger.dart';

Target of URI doesn't exist: 'visual-recognition-visual-recognition-v3.swagger.dart'.

However in other files the imports generates fine, - are replaced with _, e.g. visual_recognition_visual_recognition_v3.swagger file:

import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
import 'package:chopper/chopper.dart';
import 'package:chopper/chopper.dart' as chopper;
import 'visual_recognition_visual_recognition_v3.enums.swagger.dart' as enums;
export 'visual_recognition_visual_recognition_v3.enums.swagger.dart';

part 'visual_recognition_visual_recognition_v3.swagger.chopper.dart';
part 'visual_recognition_visual_recognition_v3.swagger.g.dart';
deps ``` dependencies: flutter: sdk: flutter chopper: ^4.0.0 dev_dependencies: flutter_test: sdk: flutter build_runner: ^1.12.2 json_annotation: 4.0.1 json_serializable: 4.1.2 swagger_dart_code_generator: ^2.0.0-nullsafety.7+2 chopper_generator: ^4.0.0-nullsafety.1 ```
Vovanella95 commented 3 years ago

Please check 2.0.0-nullsafety.8

mzdm commented 3 years ago

Thanks, fixed with 2.0.0-nullsafety.8!