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
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:
Create a new client project, using openapi-generator
Update the swagger.json file outside visual studio (for example, replacing with a new version that adds methods or modifies existing ones)
Build project
Client code is not updated, new changes are not reflected
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:
Visual Studio: 2019 (Community)
Extension Version 1.2.6685
The text was updated successfully, but these errors were encountered:
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.
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: