gibahjoe / openapi-generator-dart

Openapi Generator for Dart/Flutter
BSD 3-Clause "New" or "Revised" License
112 stars 29 forks source link

Pass --skip-validate-spec to the build #116

Closed chikko80 closed 7 months ago

chikko80 commented 7 months ago

Description of the bug

Hi, i have question, i am trying for pass --skip-validate-spec to the build for hours but couldn't find any solution. Is there any way to do this?

My build always fails with the flutter package due to:

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).

i can't fix my spec as i've splitted this up. The openapi-generator cli works fine when i pass the --skip-validate-spec but i can't figure out how to do it with this package

Steps to reproduce

Question

Expected behavior

Question

Logs

art run build_runner build --delete-conflicting-outputs                                     16s  16:33:09
[INFO] Generating build script completed, took 206ms
[INFO] Reading cached asset graph completed, took 195ms
[INFO] Checking for updates since last build completed, took 909ms
[INFO] openapi_generator on lib/bloc/main_bloc.dart:

:::::::::::::::::::::::::::::::::::::::::::
::      Openapi generator for dart       ::
:::::::::::::::::::::::::::::::::::::::::::

[SEVERE] openapi_generator on lib/bloc/main_bloc.dart:
Failed to generate content.

Failed to check diff status. Unable to find spec file openapi.yaml  #0      loadSpec (package:openapi_generator/src/gen_on_spec_changes.dart:111:32)
#1      OpenapiGenerator.hasDiff (package:openapi_generator/src/openapi_generator_runner.dart:288:32)
<asynchronous suspension>
#2      OpenapiGenerator.generatorV2 (package:openapi_generator/src/openapi_generator_runner.dart:194:12)
<asynchronous suspension>

[INFO] openapi_generator on lib/bloc/main_bloc.dart:Successfully formatted code.
[INFO] openapi_generator on lib/bloc/main_bloc.dart:Found generated timestamp. Updating with 2023-11-11T16:35:25.793955
[INFO] Running build completed, took 13.0s
[INFO] Caching finalized dependency graph completed, took 202ms
[SEVERE] openapi_generator on lib/bloc/example.dart (cached):
Codegen Failed. Generator output:

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 1, Warning count: 0
Errors:
    -attribute components.securitySchemes.ValidClaims.scopes is missing

    at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:620)
    at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:647)
    at org.openapitools.codegen.cmd.Generate.execute(Generate.java:479)
    at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
    at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)


### Screenshots

_No response_

### Platform

macOS

### Library version

latest

### Flutter version

3.13.9

### Flutter channel

stable

### Additional context

_No response_
chikko80 commented 7 months ago

mybad just found it in the source code