-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Client code is not generated again when definition file is replaced externally #209
Comments
Workaround:
|
First of all, thanks for pointing this out @daniol Another workaround I can suggest is to right click on the OpenAPI spec file in the project and "Run Custom Tool" You can also open the OpenAPI spec file in Visual Studio and make a trivial whitespace change and press save, then undo the change again. Anyway, I'm not sure if its possible to handle pre-build events from Visual Studio without tampering with the project file and adding pre-build events. If the Visual Studio SDK supports such or similar events then it might be possible to implement an option to always re-generate the REST API client code before build. This would work really great especially with NSwag as the code gets generated very very quickly. Unfortunately, it would really be a bad experience with AutoRest as this takes a lot of time to generate code, OpenAPI Generator is not that slow but there is a noticeable delay until the operation is completed If I were to build such an option it would be disabled by default as it would be very opinionated of the tool to just assume that most users want this behavior. I'll have to investigate deeper for this |
Making any changes to the OpenAPI spec file (swagger.json) file with an external tool (outside Visual Studio) does not trigger the re-generation of the client code. Client code is only re-generated when the spec file is opened and modified inside Visual Studio.
Support Key:
2979cf3
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When the project is built, the plug-in should force the client to be generated again, in order to detect changes that were made outside Visual Studio.
Visual Studio Extension:
The text was updated successfully, but these errors were encountered: