gibahjoe / openapi-generator-dart

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

Target of URI doesn't exist: 'package:my_api/model/any_type.dart'. #39

Closed tiholic closed 3 years ago

tiholic commented 3 years ago

Config:

import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';

@Openapi(
    additionalProperties: AdditionalProperties(
      pubName: 'my_api',
      pubAuthor: 'XYZ',
    ),
    inputSpecFile: 'assets/schema.yaml',
    generatorName: Generator.DART_DIO,
    outputDirectory: 'api/')
class APIConfig extends OpenapiGeneratorConfig {}

With this config, I see the generated package shows this error:

Target of URI doesn't exist: 'package:chartered_api/model/any_type.dart'.

Tried using pure dart (generatorName: Generator.DART) that also throws the same error.

Also when DIO is chosen, the created dependencies are outdated. This is list of dependencies that work with build runner (alongisde flutter 2.0)

dependencies:
    dio: ^3.0.9
    built_value: ^8.0.2
    built_collection: ^5.0.0
dev_dependencies:
    built_value_generator: ^8.0.2
    build_runner: ^1.11.5
gibahjoe commented 3 years ago

Hello, please provide minimal reproducible code so that I can take a look at this.

Did the code generation complete? or was there an error in the terminal?

gibahjoe commented 3 years ago

Closing this as no clear next steps