You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a work-around in-place for the Openapi annotation: forceAlwaysRun.
From the docs:
If true, the annotated file will be modified after code generation completes.
This is a workaround to ensure this library runs every time you execute the build_runner command.
Why modify the file?
build_runner only processes files that have changed since the last run. By modifying the file, you force build_runner to recognize it as changed and re-run the generation process.
Note: Setting this to true can lead to merge conflicts in team environments, as each developer may end up modifying the annotated file.
It is not necessary to run the builder every time build_runner is called; users only need to run it when the API spec changes.
If the spec file can be loaded by build_runner (IE: the spec file is in the lib directory of the annotated package), the builder should notify build_runner the file is read. See this discussion.
Steps to reproduce
To reproduce the issue, use the Openapi annotation and make sure forceAlwaysRun is set to false.
Modify the API Specification and run dart run build_runner build -d. Observe that the Openapi generator is not run.
Description of the bug
There is a work-around in-place for the
Openapi
annotation:forceAlwaysRun
.From the docs:
It is not necessary to run the builder every time
build_runner
is called; users only need to run it when the API spec changes.If the spec file can be loaded by
build_runner
(IE: the spec file is in the lib directory of the annotated package), the builder should notifybuild_runner
the file is read. See this discussion.Steps to reproduce
To reproduce the issue, use the
Openapi
annotation and make sureforceAlwaysRun
is set to false.Modify the API Specification and run
dart run build_runner build -d
. Observe that theOpenapi
generator is not run.Minimal openapi specification
N/A
Annotation used
Expected behavior
The generator should be re-run every time
my-open-api.yml
is modified, without having to update the "Generator last run: ..." timestamp.Logs
Screenshots
No response
Platform
macOS
Library version
6.1.0
Flutter version
3.29.2
Flutter channel
stable
Additional context
The text was updated successfully, but these errors were encountered: