Skip to content
New issue

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

generator executed success but does not generate any file #173

Open
dum3ng opened this issue Jan 2, 2025 · 2 comments
Open

generator executed success but does not generate any file #173

dum3ng opened this issue Jan 2, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@dum3ng
Copy link

dum3ng commented Jan 2, 2025

Description of the bug

run the command dart run build_runner build --delete-conflicting-outputs, and the output said the generation is succeded, but no file is created.

[INFO] openapi_generator on lib/api.dart:Codegen completed successfully.
[INFO] openapi_generator on lib/api.dart:Sources generated successfully.
[INFO] openapi_generator on lib/api.dart:Successfully formatted code.
[INFO] openapi_generator on lib/api.dart:Skip spec cache because [skipIfSpecIsUnchanged] is set to false
[INFO] openapi_generator on lib/api.dart:Found generated timestamp. Updating with 2025-01-02T17:06:11.993291
[INFO] Running build completed, took 16.8s
[INFO] Caching finalized dependency graph completed, took 56ms
[INFO] Succeeded after 16.8s with 26 outputs (53 actions)

Steps to reproduce

here is the reproduction repo: https://github.com/dum3ng/openapi.git

  1. flutter pub get
  2. dart run build_runner build --delete-conflicting-outputs

no file is generated under the folder api/auth_api

Minimal openapi specification

It's in the file auth.json in the repo mentioned above .

Annotation used

it's in the repo mentioned above, lib/api.dart:

@Openapi(
  additionalProperties: DioProperties(pubName: 'auth_api', pubAuthor: 'dumeng'),
  inputSpec:
      // RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'),
      InputSpec(path: 'auth.json'),
  // RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'),
  generatorName: Generator.dio,
  runSourceGenOnOutput: true,
  skipIfSpecIsUnchanged: false,
  outputDirectory: 'api/auth_api',
)

Expected behavior

The generated api client should be in the api/auth_api folder.

Logs

No response

Screenshots

No response

Platform

Linux

Library version

6.1.0

Flutter version

3.24.3

Flutter channel

stable

Additional context

No response

@dum3ng dum3ng added the bug Something isn't working label Jan 2, 2025
@gibahjoe
Copy link
Owner

gibahjoe commented Jan 3, 2025

Hi, kindly set debug logging to true in the annotation and share the logs. Thank you.

@dum3ng
Copy link
Author

dum3ng commented Jan 4, 2025

Well turns out there is some field (info.version) in the spec file missing, and the openapi generator failed to pass the check. But I would like this package would populate the error out than to say successed but in deed it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants