-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Cannot generate chopper file #515
Comments
Hey @langtu200987
Example targets:
$default:
sources:
- lib/**
- swaggers/**
- swaggers2/**
- input_folder/**
- swagger_examples/**
- $package$
- pubspec.yaml |
@mfrischbutter I've faced with such problem too. But I don't remember how I solved it. Try to launch terminal with Administrator rules maybe |
@Vovanella95 I'm fine. I just provided a solution for his issue :) I think there is no need to start the terminal as Administrator. Idk how you manage to get the generator running, but without this line, i will get the Warning every time. targets:
$default:
sources:
- pubspec.yaml |
@mfrischbutter ahh thanks! |
Hi, root issue about |
Describe the bug
When I run: flutter packages pub run build_runner build --delete-conflicting-outputs
The swagger file is generated but chopper file can't be generated. The log show:
flutter packages pub run build_runner build --delete-conflicting-outputs
[SEVERE] chopper_generator on lib/swagger_generated_code/swagger.swagger.dart:
line 1, column 8192 of package:azota_teacher/swagger_generated_code/swagger.swagger.dart: Could not resolve annotation for
{required int? id}
.╷
1 │ @path('id')
and
[WARNING] json_serializable on lib/swagger_generated_code/swagger.swagger.dart:
Could not read the "pubspec.yaml` file associated with this package. Usage of package:json_annotation could not be verified.
To Reproduce
pubspec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
webview_flutter: ^3.0.4
chopper: ^5.1.0
json_serializable: ^6.1.4
json_annotation: ^4.7.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
swagger_dart_code_generator: ^2.8.7
build_runner: ^2.3.2
chopper_generator: ^5.1.0+1
build.yaml$package$
targets:
$default:
sources:
- lib/**
- input_folder/**
-
builders:
chopper_generator:
options:
header: "//Generated code"
swagger_dart_code_generator:
options:
input_folder: "input_folder/"
output_folder: "lib/swagger_generated_code/"
build_only_models: false
with_base_url: false
input_urls: ["https://prodazt_main.textandtool.com/swagger/api-mobile-v1/swagger.json"]
swagger: https://prodazt_main.textandtool.com/swagger/api-mobile-v1/swagger.json
The text was updated successfully, but these errors were encountered: