We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
api in question is: https://demo.api-platform.com/docs.json?spec_version=2 or https://demo.api-platform.com/docs.json
its ui is https://demo.api-platform.com/docs
Relevant error log
[INFO] Running build... [WARNING] swagger_dart_code_generator:swagger_dart_code_generator on api/bookshop.json: [WARNING] Code formatting failed. Please raise an issue on https://github.com/epam-cross-platform-lab/swagger-dart-code-generator/issues/ Reason: Could not format because the source could not be parsed: line 63, column 169 of .: Expected to find '}'. ╷ 63 │ @Get(path: '/books/{id}/reviews') Future<chopper.Response<List<ReviewReviewRead>>> booksIdReviewsGet({@Path('id') required String? id, @Query('order[id]') String? order[id], @Query('order[publicationDate]') String? order[publicationDate], @Query('book') String? book, @Query('book[]') List<String>? book[], @Query('page') int? page}); │ ^ ╵ line 90, column 118 of .: Expected to find '}'. ╷ 90 │ @Get(path: '/reviews') Future<chopper.Response<List<ReviewReviewRead>>> reviewsGet({@Query('order[id]') String? order[id], @Query('order[publicationDate]') String? order[publicationDate], @Query('book') String? book, @Query('book[]') List<String>? book[], @Query('page') int? page}); │ ^ ╵ line 34, column 124 of .: Expected to find '}'. ╷ 34 │ @Get(path: '/books') Future<chopper.Response<List<BookBookRead>>> booksGet({@Query('properties[]') List<String>? properties[], @Query('order[id]') String? order[id], @Query('order[title]') String? order[title], @Query('order[author]') String? order[author], @Query('order[isbn]') String? order[isbn], @Query('order[publicationDate]') String? order[publicationDate], @Query('title') String? title, @Query('author') String? author, @Query('page') int? page}); │ ^^ ╵ [SEVERE] chopper_generator:chopper_generator on lib/swagger_generated_code/bookshop.swagger.dart: This builder requires Dart inputs without syntax errors. bookshop.swagger.dart:63:169: Expected to find '}'. bookshop.swagger.dart:90:118: Expected to find '}'. Try fixing the errors and re-running the build. [INFO] 1.8s elapsed, 10/11 actions completed. [SEVERE] json_serializable:json_serializable on lib/swagger_generated_code/bookshop.swagger.dart: This builder requires Dart inputs without syntax errors. However, package:hisabai/swagger_generated_code/bookshop.swagger.dart (or an existing part) contains the following errors. bookshop.swagger.dart:34:124: Expected to find '}'. bookshop.swagger.dart:63:169: Expected to find '}'. bookshop.swagger.dart:90:118: Expected to find '}'. Try fixing the errors and re-running the build. [INFO] Running build completed, took 2.4s [INFO] Caching finalized dependency graph... [INFO] Caching finalized dependency graph completed, took 31ms [SEVERE] Failed after 2.4s
Seems like "name": "order[id]", in json is converted to String? order[id] in dart, which for obvious reason is generating a syntax error.
"name": "order[id]",
String? order[id]
The text was updated successfully, but these errors were encountered:
Hi @sarim , I will check it today
Sorry, something went wrong.
Hi @sarim Please check out latest prerelease. I've fixed generation issues and your file generated without issues. https://pub.dev/packages/swagger_dart_code_generator/versions/2.1.0-prerelease.5
Thanks, generation now runs without errors (y)
Successfully merging a pull request may close this issue.
api in question is:
https://demo.api-platform.com/docs.json?spec_version=2
or
https://demo.api-platform.com/docs.json
its ui is https://demo.api-platform.com/docs
Relevant error log
Seems like
"name": "order[id]",
in json is converted toString? order[id]
in dart, which for obvious reason is generating a syntax error.The text was updated successfully, but these errors were encountered: