You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ dart run build_runner buildBuilding package executable... (3.3s)Built build_runner:build_runner.[INFO] Generating build script completed, took 174ms[INFO] Precompiling build script... completed, took 3.4s[INFO] Building new asset graph completed, took 681ms[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms[INFO] Generating SDK summary completed, took 2.7s[WARNING] openapi_generator on lib/main.dart:Your current `analyzer` version may not fully support your current SDK version.Analyzer language version: 3.2.0SDK language version: 3.3.0Please update to the latest `analyzer` version (6.4.1) by running`flutter packages upgrade`.If you are not getting the latest version by running the above command, youcan try adding a constraint like the following to your pubspec to startdiagnosing why you can't get the latest version:dev_dependencies: analyzer: ^6.4.1[INFO] openapi_generator on lib/main.dart:::::::::::::::::::::::::::::::::::::::::::::: Openapi generator for dart :::::::::::::::::::::::::::::::::::::::::::::[WARNING] openapi_generator on lib/main.dart:loadSpec - /Users/brettmorgan/Documents/GitHub/myapp/.dart_tool/openapi-generator-cache.json[WARNING] openapi_generator on lib/main.dart:loadSpec - salad-api.json[INFO] openapi_generator on lib/main.dart:Loaded cached and current spec files.[INFO] openapi_generator on lib/main.dart:Dirty Spec found. Running generation.[INFO] openapi_generator on lib/main.dart:Running following command to generate openapi client - [ generate -o=salad_api_client -i=salad-api.json -g=dart --additional-properties=allowUnicodeIdentifiers=false,ensureUniqueParams=true,useEnumExtension=true,enumUnknownDefaultCase=false,prependFormOrBodyParameters=false,pubAuthor=Google,pubName=salad_api_client,legacyDiscriminatorBehavior=true,sortModelPropertiesByRequiredFlag=true,sortParamsByRequiredFlag=true,wrapper=none ][INFO] openapi_generator on lib/main.dart:Openapi generator completed successfully.[INFO] openapi_generator on lib/main.dart:Installing dependencies with generated source. flutter pub get[INFO] openapi_generator on lib/main.dart:Install completed successfully.[INFO] openapi_generator on lib/main.dart:Skipping source gen because generator does not need it.[WARNING] openapi_generator on lib/main.dart:loadSpec - salad-api.json[INFO] openapi_generator on lib/main.dart:Successfully cached spec changes.[SEVERE] openapi_generator on lib/main.dart:Failed to format generated code.Failed to format generated code. Could not format because the source could not be parsed:line 16, column 3 of lib/model/validation_error_loc_inner.dart: Expected an identifier. ╷16 │ }); │ ^ ╵line 21, column 3 of lib/model/validation_error_loc_inner.dart: Expected an identifier. ╷21 │ @override │ ^ ╵line 19, column 96 of lib/model/validation_error_loc_inner.dart: Expected to find ';'. ╷19 │ bool operator ==(Object other) => identical(this, other) || other is ValidationErrorLocInner && │ ^^ ╵line 25, column 3 of lib/model/validation_error_loc_inner.dart: Expected an identifier. ╷25 │ @override │ ^ ╵line 22, column 20 of lib/model/validation_error_loc_inner.dart: Expected to find ';'. ╷22 │ int get hashCode => │ ^^ ╵ #0 OpenapiGenerator.formatCode (package:openapi_generator/src/openapi_generator_runner.dart:486:34)<asynchronous suspension>#1 OpenapiGenerator.generatorV2.<anonymous closure> (package:openapi_generator/src/openapi_generator_runner.dart:212:9)<asynchronous suspension>#2 OpenapiGenerator.generatorV2 (package:openapi_generator/src/openapi_generator_runner.dart:211:7)<asynchronous suspension>#3 normalizeGeneratorOutput (package:source_gen/src/output_helpers.dart:10:1)<asynchronous suspension>#4 StreamCompleter.setSourceStream (package:async/src/stream_completer.dart:76:3)<asynchronous suspension>[INFO] openapi_generator on lib/main.dart:Creating generated timestamp with 2024-02-21T16:29:37.796799[INFO] Running build completed, took 8.3s[INFO] Caching finalized dependency graph completed, took 36ms[SEVERE] Failed after 8.3s
Expected behavior
Generate a valid client library.
Logs
See above
Screenshots
No response
Platform
Linux
Library version
5.0.2
Flutter version
3.19.0
Flutter channel
stable
Additional context
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.19.0, on macOS 14.3.1 23D60 darwin-arm64, locale en)
• Flutter version 3.19.0 on channel stable at /Users/brettmorgan/flutter
• Upstream repository https://github.com/flutter/flutter
• Framework revision bae5e49bc2 (7 days ago), 2024-02-13 17:46:18 -0800
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/brettmorgan/Library/Android/sdk
• Platform android-34-ext8, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.15.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] IntelliJ IDEA Community Edition (version 2023.3.2)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 77.0.1
• Dart plugin version 233.13135.65
[✓] VS Code (version 1.86.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.82.0
[✓] Connected device (3 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 14 (API 34) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.3.1 23D60 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 121.0.6167.184
[✓] Network resources
• All expected network resources are available.
• No issues found!
The text was updated successfully, but these errors were encountered:
Description of the bug
Code generator generates invalid code for an OpenAPI specification
Steps to reproduce
salad-api.json
:Expected behavior
Generate a valid client library.
Logs
Screenshots
No response
Platform
Linux
Library version
5.0.2
Flutter version
3.19.0
Flutter channel
stable
Additional context
The text was updated successfully, but these errors were encountered: