Skip to content

[BUG][dart-dio] Do not manage to run petstore with dart-dio #6439

Description

@villqrd

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Cannot run simple petstore exmaple with dart-io. Complains about *.g.dart files

openapi-generator version

4.3.1

OpenAPI declaration file content or url

https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml

Command line used for generation
java -jar openapi-generator-cli.jar generate    -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml    -g dart-dio    -o ./petstore
Steps to reproduce

Generate the client using the command above, follow the installation guidelines provided in the generated README.md and the it fails on import

Compiler message:
../deployment/dart/petstore/lib/serializers.dart:13:6: Error: Error when reading '../deployment/dart/petstore/lib/serializers.g.dart': No such file or directory
part 'serializers.g.dart';
     ^
../deployment/dart/petstore/lib/model/error.dart:4:6: Error: Error when reading '../deployment/dart/petstore/lib/model/error.g.dart': No such file or directory
part 'error.g.dart';
     ^
../deployment/dart/petstore/lib/model/pet.dart:4:6: Error: Error when reading '../deployment/dart/petstore/lib/model/pet.g.dart': No such file or directory
part 'pet.g.dart';
     ^
../deployment/dart/petstore/lib/serializers.dart:13:6: Error: Can't use '../deployment/dart/petstore/lib/serializers.g.dart' as a part, because it has no 'part of' declaration.
part 'serializers.g.dart';
     ^
../deployment/dart/petstore/lib/model/error.dart:4:6: Error: Can't use '../deployment/dart/petstore/lib/model/error.g.dart' as a part, because it has no 'part of' declaration.
part 'error.g.dart';
     ^
../deployment/dart/petstore/lib/model/pet.dart:4:6: Error: Can't use '../deployment/dart/petstore/lib/model/pet.g.dart' as a part, because it has no 'part of' declaration.
part 'pet.g.dart';
Related issues/PRs

Could not find any.

Disclaimer
Fairly new to dart and I do not know about those .g.dart files, I suppose these are some auto generated files. But they are not present in generated client. The README.md does not indicate that I should be doing any additional actions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions