-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
The wiki/documentation you have on various things are out of date and were not update since 2019 #4934
Comments
Just spent a couple of hours trying to solve issues with generated default values and nullability. To find the |
I agree. Coming from swashbuckle I am still unable to find out how Nswag works regarding generation of open API JSON out of the app (preferably .net8+). Is there any working sample, somewhere, where I could see how to extract open API Json during CI/CD pipeline without having to run the app? |
@diegosasw , @ahl-trifork I have been writing some medium articles on this very topic. See if those help you out in anyway. All of them are attached with a working github repos. so, might give you some heads up. If you need any further help. Let me know and I will be adding some complex use cases soon to my medium. @diegosasw in your scenario my article related to MSbuild will help you with u r use case |
@vamsidogiparthi thank you. Your article helped and for a simple web project it works well. When running Also, it seems that when running As I understand, NSwag runs the application in order to generate the openapi.json document, so I should have some control over the program flow when running the app from This is my nswag.json
If I specify
If I explicitly add that nuget package as dependency, it does not make any difference. I couldn't find anything in documentation to help me understand what's going on. I don't know if .NET 8 is supported or not, and why reading from settings or env variables becomes a problem, or why the configuration of |
@diegosasw sorry for the late reply. I have done similar environment specific changes to my project program.cs/startup.cs. To further continue our conversation. Can you answer my below questions?
{ |
@vamsidogiparthi thanks for the information. I finally got something working.
Yes. I've created this minimum example.
I am trying both ways. I like the MSBuild RunPostBuildEvent mechanism but, in theory, it also works with running the
Just Now I can ensure NSwag execution sets the environment
This didn't work in my
This didn't work either
But this works well
Your help is much appreciated. I wouldn't have figured this out by simply reading the documentation! |
Unfortunately, when I try to apply the same approach to an existing project which I can't share, I am getting the following errors when
Probably there are some things I need to exclude also, or probably when there are more assemblies in the equation I need to add some additional dependencies in an explicit way... |
@diegosasw sorry i got busier with other office and personal work. Where you able to figure out the issue? I am thinking its not able to find the project file or nswag.json file. Make sure the file is under the executing assemby project directory. If you need anymore help ping me. I will try to be more active on git hub. if you have discord let me know your handle i can connect help out there as well. |
Hi,
Your documentation is very outdated and not easy to understand as well. Example below wiki document is completely outofdate as we are no longer using webApiToDocument for .NET 6 or plus. Nor assembly paths etc. We have to search many sites and forums to even understand what we have to do as part of 14.08 to make it work. As .NET or microsoft is recommending NSwag for everyone. You should be vigilant enough to update your wiki as well as provide clear instructions for every use case.
Also, you nswag new creates a json document with NetCore21 framework and not document generation setting. Which is another suggestion from our side.
https://github.com/RicoSuter/NSwag/wiki/NSwag-Configuration-Document
The text was updated successfully, but these errors were encountered: