Closed RoyZengTW closed 9 months ago
I'm commenting here to say I have the same problem when I have useNextGen: true
.
Please post your @Openapi annotation code. Also confirm your spec file is correctly named and in the root of your project.
Hi, upon further investigation, looks like the inputSpecFile
parameter is not being handled for nextGen.
To resolve this issue, kindly specify a remote spec like below
@Openapi(
additionalProperties:
DioProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep..'),
inputSpecFile: 'https://petstore3.swagger.io/api/v3/openapi.json',
inputSpec: RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'), // Include this in your annotation
typeMappings: {'Pet': 'ExamplePet'},
generatorName: Generator.dio,
runSourceGenOnOutput: true,
useNextGen: true,
outputDirectory: 'api/petstore_api',
)
I will push up a fix in the next few days.
Feel free to reopen this if this does not solve your problem
Hi, this still is an issue (using 4.13.1). I'm not using a remote spec, and I don't have an URL for our spec. My workaround for now was to rename it to "openapi.yaml", but that's not a solution. It now has to be in our project root, and that's not ideal at all.
Description of the bug
I run
dart run build_runner build --delete-conflicting-outputs
and get this fail message.Steps to reproduce
dart run build_runner build --delete-conflicting-outputs
Expected behavior
Generate the openapi package
Logs
No response
Screenshots
No response
Platform
macOS
Library version
4.13.0
Flutter version
3.10.6
Flutter channel
stable
Additional context